assertEquals(god, godbis2);
assertNull(godbis2.child.get());
}
public void testRelatedSeveralQuery() {
RelatedSeveralQueryParent god = new RelatedSeveralQueryParent("god");
god.insert();
RelatedSeveralQueryChild adam1 = new RelatedSeveralQueryChild("adam1");
adam1.owner = god;
adam1.insert();
RelatedSeveralQueryChild adam2 = new RelatedSeveralQueryChild("adam2");
adam2.owner = god;
adam2.insert();
assertNotNull(god.id);
assertEquals(god.id, adam1.owner.id);
assertEquals(god.id, adam2.owner.id);
RelatedSeveralQueryParent godbis = Model.getByKey(RelatedSeveralQueryParent.class, god.id);
List<RelatedSeveralQueryChild> children = godbis.children.fetch();
assertEquals(god, godbis);
assertEquals(adam1, children.get(0));
assertEquals(adam2, children.get(1));