hprange/wounit — Issue #23: Exception when cascade deleting not saved objects
Author: hprange
Created: 2011-10-21 20:36:01+00:00
State: open
Labels: bug

Suppose Foo has a relationship to Bar marked to cascade delete. The following code produces an exception.

@Test
public void cascadeDelete() {
Foo foo = Foo.createFoo(ec);

foo.setBar(Bar.createBar(ec));
foo.deleteObject();

ec.saveChanges();
}