jamesfredley commented on code in PR #16533:
URL: https://github.com/apache/grails-core/pull/16533#discussion_r4210586414
##########
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/util/CreateKeyForProps.java:
##########
@@ -48,6 +49,12 @@ protected CreateKeyForProps(
}
public void createKeyForProps(HibernatePersistentProperty grailsProp,
String path, Table table, String columnName) {
+ if (grailsProp instanceof HibernateToManyProperty &&
!grailsProp.isSerializableType()) {
Review Comment:
This returns for every `HibernateToManyProperty` except a serializable one.
`GrailsPropertyBinder` sends `isUserButNotCollectionType()` properties through
`SimpleValueBinder` first, as a column on the owner table, and those properties
are still `HibernateToManyProperty` instances. A unique group on that column is
no longer created, so duplicates the database used to reject are allowed.
Exempt that scalar user-type path the same way as `serializable`, and add a
regression that asserts the unique key is still created.
--
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]