}
public void testCascadeToOneNewObject() {
CayenneContext context = createClientContext();
ClientMtDeleteRule related = context
.newObject(ClientMtDeleteRule.class);
context.commitChanges();
ClientMtDeleteCascade object = context
.newObject(ClientMtDeleteCascade.class);
object.setName("object");
object.setCascade(related);
context.deleteObject(object);
assertEquals(PersistenceState.TRANSIENT, object.getPersistenceState());
assertEquals(PersistenceState.DELETED, related.getPersistenceState());
assertFalse(context.deletedObjects().contains(object));
assertTrue(context.deletedObjects().contains(related));
context.commitChanges();
}