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