borinquenkid commented on code in PR #15550:
URL: https://github.com/apache/grails-core/pull/15550#discussion_r3032968606


##########
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/CompositeIdBinder.java:
##########
@@ -46,36 +47,33 @@ public CompositeIdBinder(
         this.grailsPropertyBinder = grailsPropertyBinder;
     }
 
-    public void bindCompositeId(
-            @Nonnull HibernatePersistentEntity hibernatePersistentEntity,
-            RootClass root,
-            CompositeIdentity compositeIdentity) {
-        hibernatePersistentEntity.setPersistentClass(root);
-        Component id = new Component(metadataBuildingContext, root);
+    public void bindCompositeId(@Nonnull HibernatePersistentEntity 
domainClass) {
+        if (domainClass.getIdentityProperty() instanceof 
HibernateCompositeIdentityProperty compositeIdentityProperty) {
+            Component id = getComponent(domainClass);
+
+            for (HibernatePersistentProperty property : 
compositeIdentityProperty.getParts()) {
+                var value = grailsPropertyBinder.bindProperty(property, null, 
"");
+                componentUpdater.updateComponent(id, null, property, value);
+            }
+            return;
+        }
+        throw new MappingException("Invalid simple id binding for entity [" + 
domainClass.getName() + "]");
+    }
+
+    private @NonNull Component getComponent(@NonNull HibernatePersistentEntity 
domainClass) {

Review Comment:
   Let me make a global commit on that, legacy naming 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to