Browse Source

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

Matthew Porter 19 years ago
parent
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);
+                            }
                         }
                     }
                 }