matrei opened a new pull request, #16541:
URL: https://github.com/apache/grails-core/pull/16541

   Hibernate 5 counterpart of #16533.
   
   ## Problem
   - Enum: a `unique` group on an enum property created no unique key, so the 
database accepted duplicates.
   - Collection: a `unique` group on a collection property created a key on the 
collection table over a column of the owner table. The DDL failed at startup 
with `Column "X" not found` (logged, the table itself is created).
   
   ## Fix
   The enum binding creates the group key as other columns do (both the 
`mapping` and `constraints` forms). A collection property gets no group key, 
since its table does not hold the other columns. Serializable collections are 
not affected; Hibernate 5 never created group keys for them.
   
   ## Compatibility
   Enum unique groups now get a database key. With `create`, duplicates are 
rejected. With `update`, adding the key to a table that already holds 
duplicates fails and is only logged.
   
   ## Tests
   New `UniqueGroupEnumAndCollectionSpec`. The enum and collection-key features 
fail without the fix. `grails-data-hibernate5-core`: 629 tests, 0 failures.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to