Key keyWithParent = KeyFactory.stringToKey(ha.getId());
assertNull(keyWithParent.getParent());
}
public void testKeyPKKeyAncestor_NamedKey() throws EntityNotFoundException {
HasKeyAncestorKeyPkJDO pojo = new HasKeyAncestorKeyPkJDO();
Entity flightEntity = Flight.newFlightEntity("parent named key", "max", "bos", "mia", 3, 4);
ds.put(flightEntity);
Key flightKey = flightEntity.getKey();
Key pojoKey = new Entity(HasKeyAncestorKeyPkJDO.class.getSimpleName(), "child named key", flightKey).getKey();
pojo.setKey(pojoKey);
beginTxn();
pm.makePersistent(pojo);
commitTxn();
ds.get(pojoKey);
beginTxn();
pojo = pm.getObjectById(HasKeyAncestorKeyPkJDO.class, pojoKey);
assertEquals(pojo.getAncestorKey(), pojoKey.getParent());
commitTxn();
}