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