new String[] { "id", "defaults_table3_id" },
new Object[] { 1, 1 });
DefaultsTable4 o = (DefaultsTable4) DataObjectUtils.objectForPK(
getContext(), DefaultsTable4.class, 1);
DefaultsTable3 o1 = (DefaultsTable3) DataObjectUtils.objectForPK(
getContext(), DefaultsTable3.class, 1);
DefaultsTable3 o2 = (DefaultsTable3) DataObjectUtils.objectForPK(
getContext(), DefaultsTable3.class, 2);
assertEquals(1, o1.getDefaultTable4s().size());
assertEquals(0, o2.getDefaultTable4s().size());
o2.addToDefaultTable4s(o);
assertEquals(1, o2.getDefaultTable4s().size());
getContext().commitChanges();
assertEquals(1, o2.getDefaultTable4s().size());
getContext().performQuery(new RefreshQuery());
// note that the old to-many is only refreshed after invalidation with
// RefreshQuery... should this be treated as a bug?
assertEquals(0, o1.getDefaultTable4s().size());
assertEquals(1, o2.getDefaultTable4s().size());
}