Proposal to add 2 methods to OpenJPAPersistence:
Could we add the following 2 methods that would conceptually do the
following?
// o is a persistence capable object.
public static Object getObjectId(Object o) {
return OpenJPAPersistence.getEntityManager(o).getObjectId(o);
}
and
static public Object getOpenJPAObjectId(Object o) {
Object objId =
OpenJPAPersistence.getEntityManager(o).getObjectId(o);
return
JPAFacadeHelper.toOpenJPAObjectId(JPAFacadeHelper.getMetaData(o), objId);
}
This would save quite some typing...
Frederic
PS: the code inside is just to illustrate the intent - it should of couse
be optimized.