This is an automated email from the ASF dual-hosted git repository. borinquenkid pushed a commit to branch 9.0.x-h7-improvement-phase3 in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit f5abd46967774887e268f88b757bceedecf96c2d Author: Walter Duque de Estrada <[email protected]> AuthorDate: Tue Oct 6 17:07:12 2026 -0500 test: follow upstream's composite ident() and list the custom-type refusal of the generated mode Upstream's GormInstanceApi.ident() now returns a snapshot instance holding the composite key instead of null, so the composite id spec asserts that (class, key values, a separate instance), in both modes. Upstream's new fixtures UserTypeComparisonItem and JpaCriteriaQueryCreatorSpecGraded map a value object with type: SomeUserType, which the binder reads as a HibernateCustomProperty; the generator documents custom-type properties as not supported yet and refuses them, so the DDL differential lists that refusal explicitly (a gap to close, not a mapping no annotation can state). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --- .../tests/generated/GeneratedDomainClassesCompositeIdSpec.groovy | 7 +++++-- .../jpa/GeneratedDomainClassesDdlDifferentialSpec.groovy | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/grails-data-hibernate7/core/src/test/groovy/grails/gorm/tests/generated/GeneratedDomainClassesCompositeIdSpec.groovy b/grails-data-hibernate7/core/src/test/groovy/grails/gorm/tests/generated/GeneratedDomainClassesCompositeIdSpec.groovy index f01bff4b86..fa7a87259c 100644 --- a/grails-data-hibernate7/core/src/test/groovy/grails/gorm/tests/generated/GeneratedDomainClassesCompositeIdSpec.groovy +++ b/grails-data-hibernate7/core/src/test/groovy/grails/gorm/tests/generated/GeneratedDomainClassesCompositeIdSpec.groovy @@ -163,11 +163,14 @@ class GeneratedDomainClassesCompositeIdSpec extends HibernateGormDatastoreSpec { when: GdcCidItem loaded = GdcCidItem.get(new GdcCidItem(region: 'eu', code: 'a')) - then: "Hibernate's identifier is an instance of the entity class that carries the key; GORM's ident() has no value for a composite identifier, as with the binder" + then: "Hibernate's identifier is an instance of the entity class that carries the key; GORM's ident() is a separate instance of the same class that holds a copy of the key properties, as with the binder" sessionFactory.persistenceUnitUtil.getIdentifier(loaded).getClass() == GdcCidItem sessionFactory.persistenceUnitUtil.getIdentifier(loaded).code == 'a' sessionFactory.persistenceUnitUtil.getIdentifier(loaded).region == 'eu' - loaded.ident() == null + loaded.ident().getClass() == GdcCidItem + ((GdcCidItem) loaded.ident()).region == 'eu' + ((GdcCidItem) loaded.ident()).code == 'a' + !loaded.ident().is(loaded) sessionFactory.currentSession.getReference(GdcCidItem, new GdcCidItem(region: 'eu', code: 'a')).label == 'first' GdcCidItem.proxy(new GdcCidItem(region: 'eu', code: 'a')).label == 'first' GdcCidItem.lock(new GdcCidItem(region: 'eu', code: 'a')).label == 'first' diff --git a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GeneratedDomainClassesDdlDifferentialSpec.groovy b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GeneratedDomainClassesDdlDifferentialSpec.groovy index 7f68a66914..6b03637b9d 100644 --- a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GeneratedDomainClassesDdlDifferentialSpec.groovy +++ b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/jpa/GeneratedDomainClassesDdlDifferentialSpec.groovy @@ -90,6 +90,10 @@ class GeneratedDomainClassesDdlDifferentialSpec extends Specification { 'which is not a persistent property of the entity', 'is a registered type with type parameters', 'the index column of the map is mapped with the type', + // not stated by an annotation because the generator does not describe a custom-type property yet (a value object mapped + // with type: SomeUserType, UserTypeComparisonItem and JpaCriteriaQueryCreatorSpecGraded in the scanned domains): a gap to + // close by treating it like a simple property with a UserType, not a mapping that cannot be stated + 'is a HibernateCustomProperty, which the generator does not support yet', ] private static final AtomicInteger BOOTS = new AtomicInteger()
