Hi \ !
I have configured my app with mssql-jdbc driver and always encrypted turned on. I have an entity with a @ManyToMany association as described :
{code:java} @ManyToMany(cascade = { CascadeType. PERSIST, CascadeType. MERGE }) @JoinTable(name = " account_manage account_authority ", joinColumns = @JoinColumn(name = "ACC_ID"), inverseJoinColumns = @JoinColumn(name = " MAN_CODE AUTH_NAME ")) @JsonIgnore private List Set < Manage Authority > manageCodes authorities = new ArrayList HashSet <>(); {code}
I configured hibernate with {code:java} hibernate.use_nationalized_character_data = true {code}
When I try to save my entity, insert is done in the join table but I get an error :
{code:java} 14:35:12.101 [http-nio-8080-exec-1] WARN o.h.e.jdbc.spi.SqlExceptionHelper - SQL Error: 402, SQLState: S0002 14:35:12.102 [http-nio-8080-exec-1] ERROR o.h.e.jdbc.spi.SqlExceptionHelper - The data types nvarchar and nvarchar(17) encrypted with (encryption_type = 'DETERMINISTIC', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'CEK_Auto1', column_encryption_key_database_name = 'cpa-dev-02-db') are incompatible in the equal to operator. 14:35:12.109 [http-nio-8080-exec-1] INFO o.h.e.i.DefaultLoadEventListener - HHH000327: Error performing load command : org.hibernate.exception.SQLGrammarException: could not extract ResultSet org.hibernate.exception.SQLGrammarException: could not extract ResultSet {code}
Do i have to fix length for every field because i use always encrypted ? |
|