}
public void testInsert_NewParentAndChild_StringPk_NoTxn() throws Exception {
testInsert_NewParentAndChild_StringPk(NEW_EM_START_END);
}
private void testInsert_NewParentAndChild_StringPk(StartEnd startEnd) throws Exception {
BidirectionalChildStringPkListJPA bidirChild = new BidirectionalChildStringPkListJPA();
bidirChild.setChildVal("yam");
Book b = newBook();
HasKeyPkJPA hasKeyPk = new HasKeyPkJPA();
hasKeyPk.setStr("yag");
HasOneToManyStringPkListJPA parent = new HasOneToManyStringPkListJPA();
parent.setId("yar");
parent.getBidirChildren().add(bidirChild);
bidirChild.setParent(parent);
parent.getBooks().add(b);
parent.getHasKeyPks().add(hasKeyPk);
parent.setVal("yar");
startEnd.start();
em.persist(parent);
startEnd.end();
assertNotNull(bidirChild.getId());
assertNotNull(b.getId());
assertNotNull(hasKeyPk.getId());
Entity bidirChildEntity = ds.get(KeyFactory.stringToKey(bidirChild.getId()));
assertNotNull(bidirChildEntity);
assertEquals("yam", bidirChildEntity.getProperty("childVal"));
assertEquals(KeyFactory.stringToKey(bidirChild.getId()), bidirChildEntity.getKey());
assertKeyParentEquals(parent.getClass(), parent.getId(), bidirChildEntity, bidirChild.getId());
Entity bookEntity = ds.get(KeyFactory.stringToKey(b.getId()));
assertNotNull(bookEntity);
assertEquals("max", bookEntity.getProperty("author"));
assertEquals("22333", bookEntity.getProperty("isbn"));