use of org.apache.cayenne.testdo.mt.MtTable2 in project cayenne by apache.
the class CayenneContextRelationshipsIT method testLostUncommittedToOneModifications_Server.
@Test
public void testLostUncommittedToOneModifications_Server() throws Exception {
tMtTable1.insert(1, "G1", "S1");
tMtTable1.insert(2, "G2", "S2");
tMtTable2.insert(33, 1, "GX");
MtTable2 o = Cayenne.objectForPK(serverContext, MtTable2.class, 33);
MtTable1 r2 = Cayenne.objectForPK(serverContext, MtTable1.class, 2);
MtTable1 r1 = o.getTable1();
o.setTable1(r2);
assertSame(r2, o.getTable1());
assertFalse(r1.getTable2Array().contains(o));
assertSame(r2, o.getTable1());
}
Aggregations