List result = context.performQuery(q);
assertEquals(1, result.size());
}
public void testUpdateRelated() {
DataContext context = createDataContext();
DataObject g1 = (DataObject) context.newObject("Generic1");
g1.writeProperty("name", "G1 Name");
DataObject g2 = (DataObject) context.newObject("Generic2");
g2.writeProperty("name", "G2 Name");
g2.setToOneTarget("toGeneric1", g1, true);
context.commitChanges();
List r1 = (List) g1.readProperty("generic2s");
assertTrue(r1.contains(g2));
DataObject g11 = (DataObject) context.newObject("Generic1");
g11.writeProperty("name", "G11 Name");
g2.setToOneTarget("toGeneric1", g11, true);
context.commitChanges();
List r11 = (List) g11.readProperty("generic2s");
assertTrue(r11.contains(g2));
List r1_1 = (List) g1.readProperty("generic2s");