borinquenkid commented on code in PR #16533:
URL: https://github.com/apache/grails-core/pull/16533#discussion_r4190855223


##########
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/util/CreateKeyForProps.java:
##########
@@ -48,6 +49,11 @@ protected CreateKeyForProps(
     }
 
     public void createKeyForProps(HibernatePersistentProperty grailsProp, 
String path, Table table, String columnName) {
+        if (grailsProp instanceof HibernateToManyProperty) {
+            // The column of a collection property lives in the collection 
table, which does not hold the columns
+            // of the other properties of the group, so a unique group has no 
key to create there.
+            return;
+        }

Review Comment:
   Good catch: the exclusion now applies only to to-many properties bound as 
collections (`!isSerializableType()`), so a `type: 'serializable'` to-many in a 
unique group keeps its key on the owner table. Covered by a new 
`CreateKeyForPropsSpec` row and a runtime case in 
`UniqueGroupEnumAndCollectionSpec` (ff5196ca7d). The branch also merges 8.0.x 
now to clear the conflict with #16524 (4e975f4380).



-- 
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