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 2c058cbe0623102be27db7991a4ba23c7fe7839e Author: Walter Duque de Estrada <[email protected]> AuthorDate: Fri Feb 13 14:25:11 2026 -0600 refactor unused function and move updatable --- .../grails/orm/hibernate/cfg/PropertyConfig.groovy | 2 +- .../binder/NaturalIdentifierBinder.java | 2 +- .../cfg/domainbinding/binder/PropertyBinder.java | 15 ++------------ .../secondpass/CollectionSecondPassBinder.java | 6 +++--- .../secondpass/ListSecondPassBinder.java | 2 +- .../cfg/domainbinding/PropertyBinderSpec.groovy | 24 ---------------------- 6 files changed, 8 insertions(+), 43 deletions(-) diff --git a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/PropertyConfig.groovy b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/PropertyConfig.groovy index 51d353dcf8..ff8f16611e 100644 --- a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/PropertyConfig.groovy +++ b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/PropertyConfig.groovy @@ -106,7 +106,7 @@ class PropertyConfig extends Property { * @deprecated Use updatable instead */ @Deprecated - void setUpdateable(boolean updateable) { + void setUpdatable(boolean updateable) { this.updatable = updateable } diff --git a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/NaturalIdentifierBinder.java b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/NaturalIdentifierBinder.java index cec11c05ae..0dec49abab 100644 --- a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/NaturalIdentifierBinder.java +++ b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/NaturalIdentifierBinder.java @@ -43,7 +43,7 @@ public class NaturalIdentifierBinder { .map(persistentClass::getProperty) .map(property -> { property.setNaturalIdentifier(true); - property.setUpdateable(naturalId.isMutable()); + property.setUpdatable(naturalId.isMutable()); uk.addColumns(property.getValue()); return 1; }) diff --git a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/PropertyBinder.java b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/PropertyBinder.java index 12984457a9..7552d05a08 100644 --- a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/PropertyBinder.java +++ b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/PropertyBinder.java @@ -48,10 +48,10 @@ public class PropertyBinder { if (persistentProperty.isBidirectionalManyToOneWithListMapping(prop)) { prop.setInsertable(false); - prop.setUpdateable(false); + prop.setUpdatable(false); } else { prop.setInsertable(config.getInsertable()); - prop.setUpdateable(config.getUpdatable()); + prop.setUpdatable(config.getUpdatable()); } var accessType = AccessType.getAccessStrategy(config.getAccessType()); @@ -81,15 +81,4 @@ public class PropertyBinder { } return prop; } - - public void bindProperty(GrailsHibernatePersistentProperty persistentProperty, Property prop) { - Property bound = bindProperty(persistentProperty, prop.getValue()); - prop.setName(bound.getName()); - prop.setInsertable(bound.isInsertable()); - prop.setUpdateable(bound.isUpdateable()); - prop.setPropertyAccessorName(bound.getPropertyAccessorName()); - prop.setOptional(bound.isOptional()); - prop.setCascade(bound.getCascade()); - prop.setLazy(bound.isLazy()); - } } diff --git a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/secondpass/CollectionSecondPassBinder.java b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/secondpass/CollectionSecondPassBinder.java index c53b7698b8..7c8e55b87f 100644 --- a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/secondpass/CollectionSecondPassBinder.java +++ b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/secondpass/CollectionSecondPassBinder.java @@ -426,9 +426,9 @@ public class CollectionSecondPassBinder { } if (unidirectionalCount > 1) { - key.setUpdateable(false); + key.setUpdatable(false); } else { - key.setUpdateable(true); + key.setUpdatable(true); } } @@ -450,7 +450,7 @@ public class CollectionSecondPassBinder { key = new DependantValue(metadataBuildingContext, collection.getCollectionTable(), keyValue); key.setTypeName(null); key.setNullable(true); - key.setUpdateable(true); + key.setUpdatable(true); //JPA now requires to check for sorting key.setSorted(collection.isSorted()); diff --git a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/secondpass/ListSecondPassBinder.java b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/secondpass/ListSecondPassBinder.java index c9eed1ffee..05e3cbe9b8 100644 --- a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/secondpass/ListSecondPassBinder.java +++ b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/secondpass/ListSecondPassBinder.java @@ -99,7 +99,7 @@ public class ListSecondPassBinder { if (!property.isCircular()) { value.setNullable(false); } - value.setUpdateable(true); + value.setUpdatable(true); prop.setOptional(false); referenced.addProperty(prop); diff --git a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/PropertyBinderSpec.groovy b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/PropertyBinderSpec.groovy index 436d76c466..6a0d5104ae 100644 --- a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/PropertyBinderSpec.groovy +++ b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/PropertyBinderSpec.groovy @@ -104,30 +104,6 @@ class PropertyBinderSpec extends HibernateGormDatastoreSpec { property.getPropertyAccessorName() == "property" } - void "test bindProperty with Property object"() { - given: - def cascadeBehaviorFetcher = Mock(CascadeBehaviorFetcher) - def binder = new PropertyBinder(cascadeBehaviorFetcher) - - def persistentProperty = Mock(GrailsHibernatePersistentProperty) - persistentProperty.getName() >> "name" - persistentProperty.isNullable() >> true - def property = new Property() - def value = Mock(Value) - property.setValue(value) - def config = new PropertyConfig() - config.setAccessType(jakarta.persistence.AccessType.PROPERTY) - persistentProperty.getMappedForm() >> config - - when: - binder.bindProperty(persistentProperty, property) - - then: - property.getName() == "name" - property.isOptional() == true - property.getPropertyAccessorName() == "property" - } - } @Entity
