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.