APPLICATION_IDENTITY);
return;
}
pm = getPM();
Transaction tx = pm.currentTransaction();
ICompany icompany = (ICompany)pm.newInstance(PICompany.class);
icompany.setCompanyid(1001);
icompany.setName("GooTube");
icompany.setFounded(new Date());
tx.begin();
pm.makePersistent(icompany);
LongIdentity ioid = (LongIdentity)pm.getObjectId(icompany);
tx.commit();
Class pICompanyOidTargetClass = ioid.getTargetClass();
if (pICompanyOidTargetClass != PICompany.class)
appendMessage(ASSERTION_FAILED +
" getObjectId(icompany) should return interface class.\n" +
"expected: " + icompany.getClass().getName() + "\n" +
"actual: " + pICompanyOidTargetClass.getName());
failOnError();
}