}
public void testChangeRel() throws Exception {
ObjectContext child = clientContext.createChildContext();
ClientMtTable1 a = child.newObject(ClientMtTable1.class);
ClientMtTable2 b = child.newObject(ClientMtTable2.class);
child.commitChanges();
assertEquals(PersistenceState.COMMITTED, a.getPersistenceState());
a.addToTable2Array(b);
assertEquals(PersistenceState.MODIFIED, a.getPersistenceState());
child.commitChangesToParent();
ClientMtTable1 parentA = (ClientMtTable1) clientContext.getGraphManager().getNode(
a.getObjectId());
assertEquals(PersistenceState.COMMITTED, a.getPersistenceState());
assertEquals(PersistenceState.MODIFIED, parentA.getPersistenceState());
assertEquals(1, parentA.getTable2Array().size());
clientContext.commitChanges();
assertEquals(PersistenceState.COMMITTED, parentA.getPersistenceState());
a.removeFromTable2Array(b);
assertEquals(PersistenceState.MODIFIED, a.getPersistenceState());
child.commitChangesToParent();
assertEquals(PersistenceState.COMMITTED, a.getPersistenceState());
assertEquals(PersistenceState.MODIFIED, parentA.getPersistenceState());
assertEquals(0, parentA.getTable2Array().size());
}