assertKeyParentEquals(parent.getId(), childEntity, childEntity.getKey());
}
public void testOneToOnePersistCascadePersist() throws EntityNotFoundException {
HasOneToOnesWithDifferentCascadesJDO parent = new HasOneToOnesWithDifferentCascadesJDO();
HasStringAncestorKeyPkJDO child = new HasStringAncestorKeyPkJDO();
parent.setCascadePersistChild(child);
beginTxn();
pm.makePersistent(parent);
commitTxn();
beginTxn();
parent = pm.getObjectById(HasOneToOnesWithDifferentCascadesJDO.class, parent.getId());
child = pm.getObjectById(HasStringAncestorKeyPkJDO.class, child.getKey());
assertEquals(parent.getId(), child.getAncestorKey());
assertNotNull(parent.getCascadePersistChild());
commitTxn();
Entity childEntity = ds.get(child.getKey());
assertKeyParentEquals(parent.getId(), childEntity, childEntity.getKey());
}