Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0RC1
-
None
-
None
Description
Project with flattened relationships between inherited objects can't handle correctly removing of relationship when one of objects is removed. Following patch add the testcase which is failing in both 3.0RC1 and trunk branches with message:
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.027 sec <<< FAILURE!
testCAY1009SideEffect(org.apache.cayenne.UserManagerTest) Time elapsed: 0.023 sec <<< ERROR!
org.apache.cayenne.reflect.PropertyException: [v.3.0RC1 Ñ.нв 27 2010 13:48:57] Error unsetting to-many DataObject property: roleGroups
at org.apache.cayenne.reflect.generic.DataObjectToManyProperty.removeTarget(DataObjectToManyProperty.java:91)
at org.apache.cayenne.access.DataContextDeleteAction$1.visitToMany(DataContextDeleteAction.java:212)
at org.apache.cayenne.reflect.generic.DataObjectToManyProperty.visit(DataObjectToManyProperty.java:111)
at org.apache.cayenne.access.DataContextDeleteAction.processDeleteRules(DataContextDeleteAction.java:202)
at org.apache.cayenne.access.DataContextDeleteAction.deletePersistent(DataContextDeleteAction.java:107)
at org.apache.cayenne.access.DataContextDeleteAction.performDelete(DataContextDeleteAction.java:92)
at org.apache.cayenne.access.DataContext.deleteObject(DataContext.java:931)
at org.apache.cayenne.UserManagerTest.testCAY1009SideEffect(UserManagerTest.java:39)
Caused by: java.lang.NullPointerException
at org.apache.cayenne.CayenneDataObject.removeToManyTarget(CayenneDataObject.java:250)
at org.apache.cayenne.reflect.generic.DataObjectToManyProperty.removeTarget(DataObjectToManyProperty.java:85)
... 32 more