Entity childEntity = ds.get(KeyFactory.stringToKey(child.getId()));
assertKeyParentEquals(parent.getId(), childEntity, childEntity.getKey());
}
public void testOneToOnePersistChildWithKeyAncestorCascadeAll() throws EntityNotFoundException {
HasOneToOnesWithDifferentCascadesJDO parent = new HasOneToOnesWithDifferentCascadesJDO();
HasKeyAncestorStringPkJDO child = new HasKeyAncestorStringPkJDO();
parent.setCascadeAllChildWithKeyAncestor(child);
beginTxn();
pm.makePersistent(parent);
commitTxn();
beginTxn();
parent = pm.getObjectById(HasOneToOnesWithDifferentCascadesJDO.class, parent.getId());
child = pm.getObjectById(HasKeyAncestorStringPkJDO.class, child.getKey());
assertEquals(parent.getId(), KeyFactory.keyToString(child.getAncestorKey()));
assertNotNull(parent.getCascadeAllChildWithKeyAncestor());
commitTxn();
Entity childEntity = ds.get(KeyFactory.stringToKey(child.getKey()));
assertKeyParentEquals(parent.getId(), childEntity, childEntity.getKey());
}