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


The following commit(s) were added to refs/heads/8.0.x-hibernate7 by this push:
     new db31a1f981 Issue 14716: H7 fix for this
db31a1f981 is described below

commit db31a1f9815e3e70ea7c72b1290f51825941647a
Author: Walter Duque de Estrada <[email protected]>
AuthorDate: Mon May 18 18:32:45 2026 -0500

    Issue 14716: H7 fix for this
---
 .../CompositeKeyJoinTableIntegrationSpec.groovy    | 40 ++++++++++++++++
 .../org/grails/orm/hibernate/cfg/JoinTable.groovy  | 23 ++++++++--
 .../grails/orm/hibernate/cfg/PropertyConfig.groovy | 15 +++++-
 .../cfg/domainbinding/binder/ManyToOneBinder.java  | 31 +++++++++++--
 .../hibernate/HibernatePersistentProperty.java     |  5 +-
 .../secondpass/CollectionKeyBinder.java            | 15 ++++--
 .../mapping/HibernateMappingBuilderSpec.groovy     |  2 +-
 .../hibernate/mapping/MappingBuilderSpec.groovy    |  4 +-
 .../CompositeKeyJoinTableIntegrationSpec.groovy    | 39 ++++++++++++++++
 .../grails/orm/hibernate/cfg/JoinTableSpec.groovy  | 53 ++++++++++++++++++++++
 .../orm/hibernate/cfg/PropertyConfigSpec.groovy    | 11 ++++-
 .../org/grails/orm/hibernate/cfg/TableSpec.groovy  |  8 ++--
 .../cfg/domainbinding/ManyToOneBinderSpec.groovy   |  4 +-
 13 files changed, 224 insertions(+), 26 deletions(-)

diff --git 
a/grails-data-hibernate5/core/src/test/groovy/grails/gorm/specs/CompositeKeyJoinTableIntegrationSpec.groovy
 
b/grails-data-hibernate5/core/src/test/groovy/grails/gorm/specs/CompositeKeyJoinTableIntegrationSpec.groovy
new file mode 100644
index 0000000000..16ad4e010c
--- /dev/null
+++ 
b/grails-data-hibernate5/core/src/test/groovy/grails/gorm/specs/CompositeKeyJoinTableIntegrationSpec.groovy
@@ -0,0 +1,40 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    https://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package grails.gorm.specs
+
+import org.grails.orm.hibernate.cfg.JoinTable
+import org.grails.orm.hibernate.cfg.ColumnConfig
+
+class CompositeKeyJoinTableIntegrationSpec extends HibernateGormDatastoreSpec {
+
+    def "should bind joinTable with composite key mapping"() {
+        given:
+        def joinTable = new JoinTable(
+            keys: [new ColumnConfig(name: 'a_col'), new ColumnConfig(name: 
'b_col')],
+            column: new ColumnConfig(name: 'c')
+        )
+
+        expect:
+        joinTable.keys*.name == ['a_col', 'b_col']
+        joinTable.getKey().name == 'a_col'
+        joinTable.column.name == 'c'
+    }
+
+    // Add more integration scenarios as composite key support evolves
+}
diff --git 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/JoinTable.groovy
 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/JoinTable.groovy
index ed1d8b201f..cfe925d8fc 100644
--- 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/JoinTable.groovy
+++ 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/JoinTable.groovy
@@ -51,9 +51,24 @@ import groovy.transform.builder.SimpleStrategy
 class JoinTable extends Table {
 
     /**
-     * The foreign key column
+     * The foreign key columns (composite key support)
      */
-    ColumnConfig key
+    List<ColumnConfig> keys = []
+
+    void setKeys(List<ColumnConfig> keys) {
+        this.keys = keys
+    }
+
+    /**
+     * Configures the keys
+     * @param names The key names
+     * @return This join table config
+     */
+    JoinTable keys(List names) {
+        this.keys = (List<ColumnConfig>) names.collect { it instanceof 
ColumnConfig ? it : new ColumnConfig(name: it.toString()) }
+        return this
+    }
+
     /**
      * The child id column
      */
@@ -65,7 +80,7 @@ class JoinTable extends Table {
      * @return This join table config
      */
     JoinTable key(@DelegatesTo(ColumnConfig) Closure columnConfig) {
-        key = ColumnConfig.configureNew(columnConfig)
+        keys = [ColumnConfig.configureNew(columnConfig)]
         return this
     }
     /**
@@ -84,7 +99,7 @@ class JoinTable extends Table {
      * @return This join table config
      */
     JoinTable key(String columnName) {
-        key = new ColumnConfig(name: columnName)
+        keys = [new ColumnConfig(name: columnName)]
         return this
     }
 
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 1d455844f6..b0605f22ec 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
@@ -220,6 +220,13 @@ class PropertyConfig extends Property {
      */
     JoinTable joinTable = new JoinTable()
 
+    /**
+     * Allows Java code and tests to set the join table.
+     */
+    void setJoinTable(JoinTable jt) {
+        this.joinTable = jt
+    }
+
     ColumnConfig getJoinTableColumnConfig() {
         return this.joinTable?.column
     }
@@ -254,7 +261,11 @@ class PropertyConfig extends Property {
         DataBinder dataBinder = new DataBinder(joinTable)
         dataBinder.bind(new MutablePropertyValues(joinTableDef))
         if (joinTableDef.key) {
-            joinTable.key(joinTableDef.key.toString())
+            if (joinTableDef.key instanceof Collection || 
joinTableDef.key.getClass().isArray()) {
+                joinTable.keys(joinTableDef.key as List)
+            } else {
+                joinTable.key(joinTableDef.key.toString())
+            }
         }
         if (joinTableDef.column) {
             joinTable.column(joinTableDef.column.toString())
@@ -495,7 +506,7 @@ class PropertyConfig extends Property {
     }
 
     boolean hasJoinKeyMapping() {
-        joinTable?.key != null
+        joinTable?.keys
     }
 
 }
diff --git 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/ManyToOneBinder.java
 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/ManyToOneBinder.java
index a47c6e2332..2280c0a95a 100644
--- 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/ManyToOneBinder.java
+++ 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/ManyToOneBinder.java
@@ -29,6 +29,8 @@ import org.hibernate.mapping.Table;
 import org.grails.orm.hibernate.cfg.ColumnConfig;
 import org.grails.orm.hibernate.cfg.HibernateCompositeIdentity;
 import org.grails.orm.hibernate.cfg.JoinTable;
+import java.util.List;
+import java.util.ArrayList;
 import org.grails.orm.hibernate.cfg.Mapping;
 import org.grails.orm.hibernate.cfg.PersistentEntityNamingStrategy;
 import 
org.grails.orm.hibernate.cfg.domainbinding.hibernate.GrailsHibernatePersistentEntity;
@@ -85,7 +87,7 @@ public class ManyToOneBinder {
         Table collectionTable = collection.getCollectionTable();
         GrailsHibernatePersistentEntity refDomainClass = 
otherSide.getHibernateOwner();
         Optional<HibernateCompositeIdentity> compositeId = 
refDomainClass.getHibernateCompositeIdentity();
-        if (compositeId.isEmpty() && otherSide.isCircular()) {
+        if (otherSide.isCircular()) {
             prepareCircularManyToMany(otherSide);
         }
         ManyToOne manyToOne = doBind(otherSide, refDomainClass, 
collectionTable, path);
@@ -121,9 +123,30 @@ public class ManyToOneBinder {
         }
         if (!property.getHibernateMappedForm().hasJoinKeyMapping()) {
             JoinTable jt = new JoinTable();
-            ColumnConfig columnConfig = new ColumnConfig();
-            
columnConfig.setName(namingStrategy.resolveColumnName(property.getName()) + 
FOREIGN_KEY_SUFFIX);
-            jt.setKey(columnConfig);
+            Optional<HibernateCompositeIdentity> compositeId = 
property.getHibernateOwner().getHibernateCompositeIdentity();
+            List<ColumnConfig> keyColumns = new ArrayList<>();
+            if (compositeId.isPresent() && 
compositeId.get().getPropertyNames() != null && 
compositeId.get().getPropertyNames().length > 0) {
+                List<ColumnConfig> joinKeys = 
property.getHibernateMappedForm().getJoinTable() != null ? 
property.getHibernateMappedForm().getJoinTable().getKeys() : null;
+                String[] propNames = compositeId.get().getPropertyNames();
+                if (joinKeys != null && joinKeys.size() == propNames.length) {
+                    for (int i = 0; i < propNames.length; i++) {
+                        ColumnConfig cc = new ColumnConfig();
+                        cc.setName(joinKeys.get(i).getName());
+                        keyColumns.add(cc);
+                    }
+                } else {
+                    for (String propName : propNames) {
+                        ColumnConfig cc = new ColumnConfig();
+                        cc.setName(namingStrategy.resolveColumnName(propName) 
+ FOREIGN_KEY_SUFFIX);
+                        keyColumns.add(cc);
+                    }
+                }
+            } else {
+                ColumnConfig cc = new ColumnConfig();
+                
cc.setName(namingStrategy.resolveColumnName(property.getName()) + 
FOREIGN_KEY_SUFFIX);
+                keyColumns.add(cc);
+            }
+            jt.setKeys(keyColumns);
             property.getHibernateMappedForm().setJoinTable(jt);
         }
     }
diff --git 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/hibernate/HibernatePersistentProperty.java
 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/hibernate/HibernatePersistentProperty.java
index 3a57b3d7b1..a6011131db 100644
--- 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/hibernate/HibernatePersistentProperty.java
+++ 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/hibernate/HibernatePersistentProperty.java
@@ -198,7 +198,10 @@ public interface HibernatePersistentProperty extends 
PersistentProperty<Property
     default String getColumnName(ColumnConfig cc) {
         return Optional.of(this)
                 .filter(HibernatePersistentProperty::isJoinKeyMapped)
-                .map(p -> p.getMappedForm().getJoinTable().getKey().getName())
+                .map(p -> {
+                    java.util.List<ColumnConfig> keys = 
p.getMappedForm().getJoinTable().getKeys();
+                    return keys == null || keys.isEmpty() ? null : 
keys.get(0).getName();
+                })
                 .orElseGet(
                         () -> 
Optional.ofNullable(cc).map(ColumnConfig::getName).orElseGet(this::getMappedColumnName));
     }
diff --git 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/secondpass/CollectionKeyBinder.java
 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/secondpass/CollectionKeyBinder.java
index 8c8c2ee48d..b0ad48622a 100644
--- 
a/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/secondpass/CollectionKeyBinder.java
+++ 
b/grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/secondpass/CollectionKeyBinder.java
@@ -66,14 +66,19 @@ public class CollectionKeyBinder {
             }
         } else {
             if (property.getHibernateMappedForm().hasJoinKeyMapping()) {
-                simpleValueColumnBinder.bindSimpleValue(
+                var joinTable = 
property.getHibernateMappedForm().getJoinTable();
+                var keys = joinTable.getKeys();
+                if (keys != null && keys.size() > 1) {
+                    // Composite key: delegate to DependentKeyValueBinder
+                    dependentKeyValueBinder.bind(property, key);
+                } else {
+                    // Single key: use SimpleValueColumnBinder
+                    simpleValueColumnBinder.bindSimpleValue(
                         key,
                         "long",
-                        property.getHibernateMappedForm()
-                                .getJoinTable()
-                                .getKey()
-                                .getName(),
+                        joinTable.getKeys() != null && 
!joinTable.getKeys().isEmpty() ? joinTable.getKeys().get(0).getName() : null,
                         true);
+                }
             } else if (property instanceof EmbeddedCollection) {
                 // For embedded (value-type) collections the DependantValue 
already wraps the owner PK;
                 // do not override the type name with the element class name.
diff --git 
a/grails-data-hibernate7/core/src/test/groovy/grails/gorm/hibernate/mapping/HibernateMappingBuilderSpec.groovy
 
b/grails-data-hibernate7/core/src/test/groovy/grails/gorm/hibernate/mapping/HibernateMappingBuilderSpec.groovy
index 6a7556a072..3ced81d2fd 100644
--- 
a/grails-data-hibernate7/core/src/test/groovy/grails/gorm/hibernate/mapping/HibernateMappingBuilderSpec.groovy
+++ 
b/grails-data-hibernate7/core/src/test/groovy/grails/gorm/hibernate/mapping/HibernateMappingBuilderSpec.groovy
@@ -384,7 +384,7 @@ class HibernateMappingBuilderSpec extends Specification {
         m1.getPropertyConfig('things').joinTable != null
         m2.getPropertyConfig('things').joinTable.name == 'foo'
         m3.getPropertyConfig('things').joinTable.name == 'foo'
-        m3.getPropertyConfig('things').joinTable.key.name == 'foo_id'
+        m3.getPropertyConfig('things').joinTable.keys[0].name == 'foo_id'
         m3.getPropertyConfig('things').joinTable.column.name == 'bar_id'
     }
 
diff --git 
a/grails-data-hibernate7/core/src/test/groovy/grails/gorm/hibernate/mapping/MappingBuilderSpec.groovy
 
b/grails-data-hibernate7/core/src/test/groovy/grails/gorm/hibernate/mapping/MappingBuilderSpec.groovy
index e2f107b582..dee37f463a 100644
--- 
a/grails-data-hibernate7/core/src/test/groovy/grails/gorm/hibernate/mapping/MappingBuilderSpec.groovy
+++ 
b/grails-data-hibernate7/core/src/test/groovy/grails/gorm/hibernate/mapping/MappingBuilderSpec.groovy
@@ -258,7 +258,7 @@ class MappingBuilderSpec extends Specification {
         config != null
         config.joinTable != null
         config.joinTable.name == 'foo'
-        config.joinTable.key.name == 'foo_id'
+        config.joinTable.keys[0].name == 'foo_id'
         config.joinTable.column.name == 'bar_id'
 
     }
@@ -279,7 +279,7 @@ class MappingBuilderSpec extends Specification {
         config != null
         config.joinTable != null
         config.joinTable.name == 'foo'
-        config.joinTable.key.name == 'foo_id'
+        config.joinTable.keys[0].name == 'foo_id'
         config.joinTable.column.name == 'bar_id'
 
     }
diff --git 
a/grails-data-hibernate7/core/src/test/groovy/grails/gorm/specs/CompositeKeyJoinTableIntegrationSpec.groovy
 
b/grails-data-hibernate7/core/src/test/groovy/grails/gorm/specs/CompositeKeyJoinTableIntegrationSpec.groovy
new file mode 100644
index 0000000000..267c09c954
--- /dev/null
+++ 
b/grails-data-hibernate7/core/src/test/groovy/grails/gorm/specs/CompositeKeyJoinTableIntegrationSpec.groovy
@@ -0,0 +1,39 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    https://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package grails.gorm.specs
+
+import org.grails.orm.hibernate.cfg.JoinTable
+import org.grails.orm.hibernate.cfg.ColumnConfig
+
+class CompositeKeyJoinTableIntegrationSpec extends HibernateGormDatastoreSpec {
+
+    def "should bind joinTable with composite key mapping"() {
+        given:
+        def joinTable = new JoinTable(
+            keys: [new ColumnConfig(name: 'a_col'), new ColumnConfig(name: 
'b_col')],
+            column: new ColumnConfig(name: 'c')
+        )
+
+        expect:
+        joinTable.keys*.name == ['a_col', 'b_col']
+        joinTable.column.name == 'c'
+    }
+
+    // Add more integration scenarios as composite key support evolves
+}
diff --git 
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/JoinTableSpec.groovy
 
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/JoinTableSpec.groovy
new file mode 100644
index 0000000000..83f14ad862
--- /dev/null
+++ 
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/JoinTableSpec.groovy
@@ -0,0 +1,53 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    https://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.grails.orm.hibernate.cfg
+
+import spock.lang.Specification
+
+class JoinTableSpec extends Specification {
+
+    def "should allow single key column config"() {
+        given:
+        def jt = new JoinTable(keys: [new ColumnConfig(name: 'a_col')])
+
+        expect:
+        jt.keys[0].name == 'a_col'
+    }
+
+    def "should allow child id column config"() {
+        given:
+        def jt = new JoinTable(column: new ColumnConfig(name: 'c'))
+
+        expect:
+        jt.column.name == 'c'
+    }
+
+    def "should support multiple key columns via keys field"() {
+        given:
+        def jt = new JoinTable(keys: [new ColumnConfig(name: 'a_col'), new 
ColumnConfig(name: 'b_col')])
+
+        expect:
+        jt.keys*.name == ['a_col', 'b_col']
+    }
+
+    def "keys is empty by default"() {
+        expect:
+        new JoinTable().keys.isEmpty()
+    }
+}
diff --git 
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/PropertyConfigSpec.groovy
 
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/PropertyConfigSpec.groovy
index 4f691d3aa4..03d3b083b2 100644
--- 
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/PropertyConfigSpec.groovy
+++ 
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/PropertyConfigSpec.groovy
@@ -119,6 +119,15 @@ class PropertyConfigSpec extends Specification {
         new PropertyConfig().column == null
     }
 
+    void "columns supports multiple ColumnConfig for composite keys"() {
+        given:
+        PropertyConfig pc = new PropertyConfig()
+        pc.columns = [new ColumnConfig(name: 'a_col'), new ColumnConfig(name: 
'b_col')]
+
+        expect:
+        pc.columns*.name == ['a_col', 'b_col']
+    }
+
     void "getColumn returns the column name when one column is configured"() {
         given:
         PropertyConfig pc = new PropertyConfig()
@@ -289,7 +298,7 @@ class PropertyConfigSpec extends Specification {
 
         then:
         pc.joinTable.name == 'book_tag'
-        pc.joinTable.key?.name == 'book_id'
+        pc.joinTable.keys && pc.joinTable.keys[0].name == 'book_id'
         pc.joinTable.column?.name == 'tag_id'
     }
 
diff --git 
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/TableSpec.groovy
 
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/TableSpec.groovy
index e7b14fedee..f11bfe569f 100644
--- 
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/TableSpec.groovy
+++ 
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/TableSpec.groovy
@@ -135,7 +135,7 @@ class TableSpec extends Specification {
         then:
         jt.name == 'join_table'
         jt.schema == 'public'
-        jt.key == null
+        jt.keys.isEmpty()
         jt.column == null
     }
 
@@ -148,7 +148,7 @@ class TableSpec extends Specification {
 
         then:
         result.is(jt)
-        jt.key.name == 'owner_id'
+        jt.keys[0].name == 'owner_id'
     }
 
     def "JoinTable column(String) sets column name and returns this"() {
@@ -171,8 +171,8 @@ class TableSpec extends Specification {
         jt.key { name 'fk_id'; length 20 }
 
         then:
-        jt.key.name == 'fk_id'
-        jt.key.length == 20
+        jt.keys[0].name == 'fk_id'
+        jt.keys[0].length == 20
     }
 
     def "JoinTable column(Closure) configures a ColumnConfig"() {
diff --git 
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/ManyToOneBinderSpec.groovy
 
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/ManyToOneBinderSpec.groovy
index a6f7449ff1..6cde5881f0 100644
--- 
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/ManyToOneBinderSpec.groovy
+++ 
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/ManyToOneBinderSpec.groovy
@@ -125,7 +125,7 @@ class ManyToOneBinderSpec extends 
HibernateGormDatastoreSpec {
         1 * simpleValueBinder.bindSimpleValue(otherSide, null, _ as ManyToOne, 
"/test")
 
         mapping.getColumns().get("circularProp") == propertyConfig
-        1 * propertyConfig.setJoinTable({ it.key.name == "circular_prop_id" })
+        1 * propertyConfig.setJoinTable({ it.keys && it.keys[0].name == 
"circular_prop_id" })
     }
 
     def "Test bindManyToOne (OneToOneProperty)"() {
@@ -197,7 +197,7 @@ class ManyToOneBinderSpec extends 
HibernateGormDatastoreSpec {
         then:
         result instanceof ManyToOne
         mapping.getColumns().containsKey("newProp")
-        1 * propertyConfig.setJoinTable({ it.key.name == "new_prop_id" })
+        1 * propertyConfig.setJoinTable({ it.keys && it.keys[0].name == 
"new_prop_id" })
     }
 
     private List mockEntity(boolean composite) {

Reply via email to