}
public void testInsertWithStringPkAndKeyAncestor_NamedKey() throws EntityNotFoundException {
Entity e = new Entity("yam");
ds.put(e);
HasKeyAncestorStringPkJPA hk1 = new HasKeyAncestorStringPkJPA();
Key keyToSet =
new Entity(HasKeyAncestorStringPkJPA.class.getSimpleName(), "yar", e.getKey()).getKey();
hk1.setKey(KeyFactory.keyToString(keyToSet));
beginTxn();
em.persist(hk1);
commitTxn();
String key = hk1.getKey();
assertEquals(e.getKey(), hk1.getAncestorKey());
Entity reloaded = ds.get(KeyFactory.stringToKey(key));
assertEquals(e.getKey(), reloaded.getKey().getParent());
}