Flight f = newFlight();
HasKeyPkJDO hasKeyPk = new HasKeyPkJDO();
HasOneToOneLongPkParentJDO hasParent = new HasOneToOneLongPkParentJDO();
HasOneToOneLongPkParentKeyPkJDO hasParentKeyPk = new HasOneToOneLongPkParentKeyPkJDO();
HasOneToOneLongPkJDO pojo = new HasOneToOneLongPkJDO();
pojo.setFlight(f);
pojo.setHasKeyPK(hasKeyPk);
pojo.setHasParent(hasParent);
hasParent.setParent(pojo);
pojo.setHasParentKeyPK(hasParentKeyPk);
hasParentKeyPk.setParent(pojo);
makePersistentInTxn(pojo, startEnd);
assertNotNull(f.getId());
assertNotNull(hasKeyPk.getKey());
assertNotNull(hasParent.getKey());
assertNotNull(hasParentKeyPk.getKey());
assertNotNull(pojo.getId());
Entity flightEntity = ds.get(KeyFactory.stringToKey(f.getId()));
assertNotNull(flightEntity);
assertEquals("jimmy", flightEntity.getProperty("name"));
assertEquals("bos", flightEntity.getProperty("origin"));
assertEquals("mia", flightEntity.getProperty("dest"));
assertEquals(2L, flightEntity.getProperty("me"));
assertEquals(3L, flightEntity.getProperty("you"));
assertEquals(44L, flightEntity.getProperty("flight_number"));
assertEquals(KeyFactory.stringToKey(f.getId()), flightEntity.getKey());
assertKeyParentEquals(pojo.getClass(), pojo.getId(), flightEntity, f.getId());
Entity hasKeyPkEntity = ds.get(hasKeyPk.getKey());
assertNotNull(hasKeyPkEntity);
assertEquals(hasKeyPk.getKey(), hasKeyPkEntity.getKey());
assertKeyParentEquals(pojo.getClass(), pojo.getId(), hasKeyPkEntity, hasKeyPk.getKey());
Entity hasParentEntity = ds.get(KeyFactory.stringToKey(hasParent.getKey()));
assertNotNull(hasParentEntity);
assertEquals(KeyFactory.stringToKey(hasParent.getKey()), hasParentEntity.getKey());
assertKeyParentEquals(pojo.getClass(), pojo.getId(), hasParentEntity, hasParent.getKey());
Entity hasParentKeyPkEntity = ds.get(hasParentKeyPk.getKey());
assertNotNull(hasParentKeyPkEntity);
assertEquals(hasParentKeyPk.getKey(), hasParentKeyPkEntity.getKey());
assertKeyParentEquals(pojo.getClass(), pojo.getId(), hasParentKeyPkEntity, hasParentKeyPk.getKey());
Entity pojoEntity = ds.get(TestUtils.createKey(pojo, pojo.getId()));
assertNotNull(pojoEntity);
assertEquals(flightEntity.getKey(), pojoEntity.getProperty("flight_id_OID"));
assertEquals(hasKeyPkEntity.getKey(), pojoEntity.getProperty("hasKeyPK_key_OID"));
assertEquals(hasParentEntity.getKey(), pojoEntity.getProperty("hasParent_key_OID"));
assertEquals(hasParentKeyPkEntity.getKey(), pojoEntity.getProperty("hasParentKeyPK_key_OID"));