[hibernate-issues] [JIRA] (HHH-13919) [AlwaysEncrypted] Insert in join tables with @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })

Romain Wilbert (JIRA) jira at hibernate.atlassian.net
Tue Mar 31 11:37:41 EDT 2020


Romain Wilbert ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5e835dfae57b6c0c1e67739b ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZDUzZDAwYTUzNGM4NGYxYTlhNDM3ZGM2OGJkOGZjNTEiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-13919?atlOrigin=eyJpIjoiZDUzZDAwYTUzNGM4NGYxYTlhNDM3ZGM2OGJkOGZjNTEiLCJwIjoiaiJ9 ) HHH-13919 ( https://hibernate.atlassian.net/browse/HHH-13919?atlOrigin=eyJpIjoiZDUzZDAwYTUzNGM4NGYxYTlhNDM3ZGM2OGJkOGZjNTEiLCJwIjoiaiJ9 ) [AlwaysEncrypted] Insert in join tables with @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }) ( https://hibernate.atlassian.net/browse/HHH-13919?atlOrigin=eyJpIjoiZDUzZDAwYTUzNGM4NGYxYTlhNDM3ZGM2OGJkOGZjNTEiLCJwIjoiaiJ9 )

Issue Type: Bug Affects Versions: 5.3.14 Assignee: Unassigned Components: hibernate-entitymanager Created: 31/Mar/2020 08:37 AM Priority: Major Reporter: Romain Wilbert ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5e835dfae57b6c0c1e67739b )

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 :

   @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
   @JoinTable(name = "account_manage" , joinColumns = @JoinColumn(name = "ACC_ID" ), inverseJoinColumns = @JoinColumn(name = "MAN_CODE" ))
   @JsonIgnore
   private List<Manage> manageCodes = new ArrayList<>();

I configured hibernate with

hibernate.use_nationalized_character_data = true

When I try to save my entity, insert is done in the join table but I get an error :

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 

Do i have to fix length for every field because i use always encrypted ?

( https://hibernate.atlassian.net/browse/HHH-13919#add-comment?atlOrigin=eyJpIjoiZDUzZDAwYTUzNGM4NGYxYTlhNDM3ZGM2OGJkOGZjNTEiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-13919#add-comment?atlOrigin=eyJpIjoiZDUzZDAwYTUzNGM4NGYxYTlhNDM3ZGM2OGJkOGZjNTEiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100123- sha1:a8fd8fd )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200331/8908e94b/attachment.html 


More information about the hibernate-issues mailing list