e3.setProperty("bString", "b2");
e3.setProperty("cString", "c3");
ds.put(e3);
beginTxn();
Grandchild grandchild = ((List<Grandchild>) pm.newQuery(
"select from " + grandchildClass.getName() + " where aString == 'a2'").execute()).get(0);
assertEquals(grandchildClass, grandchild.getClass());
assertEquals("a2", grandchild.getAString());
assertEquals("b1", grandchild.getBString());
assertEquals("c2", grandchild.getCString());
grandchild = ((List<Grandchild>) pm.newQuery(
"select from " + grandchildClass.getName() + " where bString == 'b2'").execute()).get(0);
assertEquals(grandchildClass, grandchild.getClass());
assertEquals("a2", grandchild.getAString());
assertEquals("b2", grandchild.getBString());
assertEquals("c3", grandchild.getCString());
grandchild = ((List<Grandchild>) pm.newQuery(
"select from " + grandchildClass.getName() + " where cString == 'c2'").execute()).get(0);
assertEquals(grandchildClass, grandchild.getClass());
assertEquals("a2", grandchild.getAString());
assertEquals("b1", grandchild.getBString());
assertEquals("c2", grandchild.getCString());
List<Grandchild> grandkids = ((List<Grandchild>) pm.newQuery(
"select from " + grandchildClass.getName() + " where aString == 'a2' order by bString desc").execute());
assertEquals(3, grandkids.size());
assertEquals(e2.getKey().getId(), grandkids.get(0).getId().longValue());