}
public void testStringId() {
ClassMetaData cmd = repo.getMetaData(StringIdEntity.class, null, true);
try {
JPAFacadeHelper.toOpenJPAObjectId(cmd, new StringIdEntity());
fail("Didn't fail!");
} catch (UserException re) {
// expected
}
String id = "StringId";
StringIdEntity entity = new StringIdEntity();
entity.setId(id);
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.persist(entity);
em.getTransaction().commit();
em.clear();
StringIdEntity persistedEntity = em.find(StringIdEntity.class, id);
StateManagerImpl smi = ((StateManagerImpl) ((PersistenceCapable) persistedEntity).pcGetStateManager());
Object oid = smi.getObjectId();
assertEquals(oid, JPAFacadeHelper.toOpenJPAObjectId(cmd, id));
}