Quellcode durchsuchen

If childObject is a collection, add the objects in the collection.

Matthew Porter vor 19 Jahren
Ursprung
Commit
53dcdf7e89

+ 5 - 1
domain/src/main/java/org/acegisecurity/domain/hibernate/IntrospectionManagerHibernate.java

@@ -127,7 +127,11 @@ public class IntrospectionManagerHibernate implements IntrospectionManager,
                             propertyType.getReturnedClass()) != null) {
                         Object childObject = classMetadata.getPropertyValue(parentObject, propertyNames[i], EntityMode.POJO);
                         if (childObject != null && Hibernate.isInitialized(childObject)) {
-                            allObjects.add(childObject);
+                            if (childObject instanceof Collection) {
+                                allObjects.addAll((Collection)childObject);
+                            } else {
+                                allObjects.add(childObject);
+                            }
                         }
                     }
                 }