Reputation: 1486
I'm trying to delete a collection of objects, but somehow they still remain.
List<Assignment> assignments = shift.getAssignments();
shift.getObjectContext().deleteObjects(assignments);
shift.getObjectContext().commitChanges();
After commitChanges executed, the only assignment in the collection has this value:
[{<ObjectId:Assignment, assignment_id=26067>; committed; // snipped for clarity
I thought that after deleteObject(), the state would be DELETED; and after commitChanges(), it should not remain in the collection. According to this: http://cayenne.apache.org/docs/3.0/persistent-object-lifecycle.html.
What am I missing?
EDIT: changed the code to remove a different data object which in turn propagate changes to the assignments.
Upvotes: 0
Views: 105
Reputation: 2563
If you want the objects to be removed from collection on delete you can do one of the two things:
Upvotes: 1