You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by bo...@apache.org on 2026/04/04 15:51:40 UTC

(grails-core) 08/11: H7 clean up arguments of SimpleValueBinder

This is an automated email from the ASF dual-hosted git repository.

borinquenkid pushed a commit to branch 8.0.x-hibernate7-dev
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit d0e34b2aa492f6c931a3ed8695d68f4d28b5580b
Author: Walter Duque de Estrada <wb...@mac.com>
AuthorDate: Fri Apr 3 16:46:58 2026 -0500

    H7 clean up arguments of SimpleValueBinder
---
 .../cfg/domainbinding/binder/GrailsPropertyBinder.java         | 10 +++++-----
 .../hibernate/cfg/domainbinding/binder/SimpleValueBinder.java  |  7 ++++---
 .../hibernate/cfg/domainbinding/SimpleValueBinderSpec.groovy   |  4 ++--
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/GrailsPropertyBinder.java b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/GrailsPropertyBinder.java
index 1fd0da8dae..9bc98e2316 100644
--- a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/GrailsPropertyBinder.java
+++ b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/GrailsPropertyBinder.java
@@ -78,7 +78,7 @@ public class GrailsPropertyBinder {
         if (currentGrailsProp instanceof HibernateEnumProperty hibernateEnumProperty) {
             value = enumTypeBinder.bindEnumType(hibernateEnumProperty, path);
         } else if (currentGrailsProp.isUserButNotCollectionType()) {
-            value = simpleValueBinder.bindSimpleValue(currentGrailsProp, parentProperty, table, path);
+            value = simpleValueBinder.bindBasicValue(currentGrailsProp, parentProperty, path);
         } else if (currentGrailsProp instanceof HibernateOneToOneProperty oneToOne &&
                 oneToOne.isValidHibernateOneToOne()) {
             value = oneToOneBinder.bindOneToOne(oneToOne, path);
@@ -92,14 +92,14 @@ public class GrailsPropertyBinder {
         } else if (currentGrailsProp instanceof HibernateEmbeddedProperty embedded) {
             value = componentBinder.bindComponent(embedded, path);
         } else if (currentGrailsProp instanceof HibernateSimpleProperty simple) {
-            value = simpleValueBinder.bindSimpleValue(simple, parentProperty, table, path);
+            value = simpleValueBinder.bindBasicValue(simple, parentProperty, path);
         } else if (currentGrailsProp instanceof HibernateCustomProperty custom) {
-            value = simpleValueBinder.bindSimpleValue(custom, parentProperty, table, path);
+            value = simpleValueBinder.bindBasicValue(custom, parentProperty, path);
         } else if (currentGrailsProp instanceof HibernateTenantIdProperty tenantId) {
-            value = simpleValueBinder.bindSimpleValue(tenantId, parentProperty, table, path);
+            value = simpleValueBinder.bindBasicValue(tenantId, parentProperty, path);
         } else if (currentGrailsProp instanceof HibernateToManyProperty toMany &&
                 currentGrailsProp.isSerializableType()) {
-            value = simpleValueBinder.bindSimpleValue(toMany, parentProperty, table, path);
+            value = simpleValueBinder.bindBasicValue(toMany, parentProperty, path);
         } else {
             throw new RuntimeException(
                     "Unsupported property type: " + currentGrailsProp.getClass().getName());
diff --git a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/SimpleValueBinder.java b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/SimpleValueBinder.java
index 7db09fbfdc..8cbf771740 100644
--- a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/SimpleValueBinder.java
+++ b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/SimpleValueBinder.java
@@ -20,6 +20,8 @@ package org.grails.orm.hibernate.cfg.domainbinding.binder;
 
 import java.util.Optional;
 
+import jakarta.annotation.Nonnull;
+
 import org.hibernate.boot.spi.MetadataBuildingContext;
 import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
 import org.hibernate.mapping.BasicValue;
@@ -68,10 +70,9 @@ public class SimpleValueBinder {
                 new BasicValueCreator(metadataBuildingContext, jdbcEnvironment, namingStrategy));
     }
 
-    public BasicValue bindSimpleValue(
-            @jakarta.annotation.Nonnull HibernatePersistentProperty property,
+    public BasicValue bindBasicValue(
+            @Nonnull HibernatePersistentProperty property,
             HibernatePersistentProperty parentProperty,
-            Table table,
             String path) {
         BasicValue basicValue = basicValueCreator.bindBasicValue(property);
         bindSimpleValue(property, parentProperty, basicValue, path);
diff --git a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/SimpleValueBinderSpec.groovy b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/SimpleValueBinderSpec.groovy
index 0c013b74f0..18a2df24d9 100644
--- a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/SimpleValueBinderSpec.groovy
+++ b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/SimpleValueBinderSpec.groovy
@@ -194,7 +194,7 @@ class SimpleValueBinderSpec extends Specification {
         namingStrategy.resolveColumnName(_) >> 'test_column'
 
         when:
-        def result = binder.bindSimpleValue(prop, null, table, null)
+        def result = binder.bindBasicValue(prop, null, null)
 
         then:
         result instanceof org.hibernate.mapping.BasicValue
@@ -264,7 +264,7 @@ class SimpleValueBinderSpec extends Specification {
         namingStrategy.resolveColumnName(_) >> 'test_column'
 
         when:
-        def result = binder.bindSimpleValue(prop, null, table, "path")
+        def result = binder.bindBasicValue(prop, null, "path")
 
         then:
         result instanceof org.hibernate.mapping.BasicValue