rollbackTxn();
}
}
public void testEncodedStringPk_SeparateNameField() throws EntityNotFoundException {
HasEncodedStringPkSeparateNameFieldJPA pojo = new HasEncodedStringPkSeparateNameFieldJPA();
pojo.setName("a name");
beginTxn();
em.persist(pojo);
commitTxn();
assertEquals(TestUtils.createKey(pojo, "a name"), KeyFactory.stringToKey(pojo.getId()));
Entity e = ds.get(KeyFactory.stringToKey(pojo.getId()));
beginTxn();
pojo = em.find(HasEncodedStringPkSeparateNameFieldJPA.class, e.getKey().getName());
assertEquals("a name", pojo.getName());
em.find(HasEncodedStringPkSeparateNameFieldJPA.class, e.getKey());
assertEquals("a name", pojo.getName());
em.find(HasEncodedStringPkSeparateNameFieldJPA.class, KeyFactory.keyToString(e.getKey()));
assertEquals("a name", pojo.getName());
commitTxn();
}