context.deleteObjects(parentGroup1);
context.deleteObjects(parentGroup2);
}
public void testReplaceDeleteWithCommit() {
ArtGroup parentGroup1 = context.newObject(ArtGroup.class);
parentGroup1.setName("parent1");
ArtGroup parentGroup2 = context.newObject(ArtGroup.class);
parentGroup2.setName("parent2");
ArtGroup childGroup1 = context.newObject(ArtGroup.class);
childGroup1.setName("child1");
childGroup1.setToParentGroup(parentGroup1);
childGroup1.setToParentGroup(parentGroup2);
context.commitChanges();
context.deleteObjects(parentGroup1);
context.deleteObjects(parentGroup2);
context.commitChanges();