This is an automated email from the ASF dual-hosted git repository. borinquenkid pushed a commit to branch 8.0.x-hibernate7 in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit e95c8a79f3232c5f317351785248596d7185dd3a Author: Walter Duque de Estrada <[email protected]> AuthorDate: Tue Feb 10 13:26:49 2026 -0600 ColumnNameForPropertyAndPathFetcher.getColumnNameForPropertyAndPath(GrailsHibernatePersistentProperty --- .../org/grails/orm/hibernate/cfg/GrailsDomainBinder.java | 2 +- .../domainbinding/ColumnNameForPropertyAndPathFetcher.java | 2 +- .../cfg/domainbinding/ComponentPropertyBinder.java | 13 +++++++++---- .../orm/hibernate/cfg/domainbinding/CreateKeyForProps.java | 2 +- .../ColumnNameForPropertyAndPathFetcherSpec.groovy | 4 ++-- .../cfg/domainbinding/CreateKeyForPropsSpec.groovy | 4 ++-- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java index c03dfc4317..26209287af 100644 --- a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java +++ b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java @@ -407,7 +407,7 @@ public class GrailsDomainBinder SimpleValue key = new DependantValue(metadataBuildingContext, mytable, joinedSubclass.getIdentifier()); joinedSubclass.setKey(key); - final PersistentProperty identifier = sub.getIdentity(); + var identifier = sub.getIdentity(); String columnName = new ColumnNameForPropertyAndPathFetcher(namingStrategy).getColumnNameForPropertyAndPath(identifier, EMPTY_PATH, null); new SimpleValueColumnBinder().bindSimpleValue(key, identifier.getType().getName(), columnName, false); diff --git a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/ColumnNameForPropertyAndPathFetcher.java b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/ColumnNameForPropertyAndPathFetcher.java index c41fd25cbc..1114e58797 100644 --- a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/ColumnNameForPropertyAndPathFetcher.java +++ b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/ColumnNameForPropertyAndPathFetcher.java @@ -32,7 +32,7 @@ public class ColumnNameForPropertyAndPathFetcher { private static final String UNDERSCORE = "_"; - public String getColumnNameForPropertyAndPath(PersistentProperty grailsProp, + public String getColumnNameForPropertyAndPath(GrailsHibernatePersistentProperty grailsProp, String path, ColumnConfig cc) { // First try the column config. String columnName = null; diff --git a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/ComponentPropertyBinder.java b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/ComponentPropertyBinder.java index 8488382b4d..06890b4c62 100644 --- a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/ComponentPropertyBinder.java +++ b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/ComponentPropertyBinder.java @@ -88,9 +88,14 @@ public class ComponentPropertyBinder { this.simpleValueBinder = null; } - public void bindComponentProperty(Component component, PersistentProperty componentProperty, - PersistentProperty currentGrailsProp, PersistentClass persistentClass, - String path, Table table, @Nonnull InFlightMetadataCollector mappings, String sessionFactoryBeanName) { + public void bindComponentProperty(Component component, + PersistentProperty componentProperty, + PersistentProperty currentGrailsProp, + PersistentClass persistentClass, + String path, + Table table, + @Nonnull InFlightMetadataCollector mappings, + String sessionFactoryBeanName) { Value value; // see if it's a collection type CollectionType collectionType = collectionHolder.get(currentGrailsProp.getType()); @@ -131,7 +136,7 @@ public class ComponentPropertyBinder { value = new BasicValue(metadataBuildingContext, table); if (currentGrailsProp.getType().isEnum()) { - String columnName = new ColumnNameForPropertyAndPathFetcher(namingStrategy).getColumnNameForPropertyAndPath(currentGrailsProp, path, null); + String columnName = new ColumnNameForPropertyAndPathFetcher(namingStrategy).getColumnNameForPropertyAndPath((GrailsHibernatePersistentProperty) currentGrailsProp, path, null); enumTypeBinder.bindEnumType((GrailsHibernatePersistentProperty) currentGrailsProp, currentGrailsProp.getType(), (SimpleValue) value, columnName); } else { diff --git a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/CreateKeyForProps.java b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/CreateKeyForProps.java index 82c40b7d9c..0acdc23f55 100644 --- a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/CreateKeyForProps.java +++ b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/CreateKeyForProps.java @@ -44,7 +44,7 @@ public class CreateKeyForProps { if (otherProp == null) { throw new MappingException(owner.getJavaClass().getName() + " references an unknown property " + propertyName); } - String otherColumnName = columnNameForPropertyAndPathFetcher.getColumnNameForPropertyAndPath(otherProp, path, null); + String otherColumnName = columnNameForPropertyAndPathFetcher.getColumnNameForPropertyAndPath((GrailsHibernatePersistentProperty) otherProp, path, null); keyList.add(new Column(otherColumnName)); } diff --git a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/ColumnNameForPropertyAndPathFetcherSpec.groovy b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/ColumnNameForPropertyAndPathFetcherSpec.groovy index 2af0a63884..2659324c88 100644 --- a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/ColumnNameForPropertyAndPathFetcherSpec.groovy +++ b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/ColumnNameForPropertyAndPathFetcherSpec.groovy @@ -80,7 +80,7 @@ class ColumnNameForPropertyAndPathFetcherSpec extends Specification { backticksRemover ) - def grailsProp = Mock(PersistentProperty) + def grailsProp = Mock(GrailsHibernatePersistentProperty) // No config available and no join mapping path grailsProp.supportsJoinColumnMapping() >> false @@ -110,7 +110,7 @@ class ColumnNameForPropertyAndPathFetcherSpec extends Specification { backticksRemover ) - def grailsProp = Mock(PersistentProperty) + def grailsProp = Mock(GrailsHibernatePersistentProperty) defaultColumnFetcher.getDefaultColumnName(grailsProp) >> "only_default" diff --git a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/CreateKeyForPropsSpec.groovy b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/CreateKeyForPropsSpec.groovy index bbe50a56e7..3462d34104 100644 --- a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/CreateKeyForPropsSpec.groovy +++ b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/CreateKeyForPropsSpec.groovy @@ -27,8 +27,8 @@ class CreateKeyForPropsSpec extends Specification { } grailsProp.getMappedForm() >> mappedForm - def otherProp1 = Mock(PersistentProperty) - def otherProp2 = Mock(PersistentProperty) + def otherProp1 = Mock(GrailsHibernatePersistentProperty) + def otherProp2 = Mock(GrailsHibernatePersistentProperty) owner.getPropertyByName("p1") >> otherProp1 owner.getPropertyByName("p2") >> otherProp2
