commitTxn();
}
public void testEncodedStringPk_SeparateIdField() throws EntityNotFoundException {
HasEncodedStringPkSeparateIdFieldJPA pojo = new HasEncodedStringPkSeparateIdFieldJPA();
pojo.setId(34L);
beginTxn();
em.persist(pojo);
commitTxn();
beginTxn();
assertNotNull(pojo.getId());
assertNotNull(pojo.getKey());
Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
long id = e.getKey().getId();
assertEquals(34L, id);
pojo = em.find(HasEncodedStringPkSeparateIdFieldJPA.class, e.getKey().getId());
assertEquals(id, pojo.getId().longValue());
em.find(HasEncodedStringPkSeparateIdFieldJPA.class, e.getKey());
assertEquals(id, pojo.getId().longValue());
em.find(HasEncodedStringPkSeparateIdFieldJPA.class, KeyFactory.keyToString(e.getKey()));
assertEquals(id, pojo.getId().longValue());
commitTxn();
}