openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frederic_Bell...@capgroup.com
Subject Add 2 methods to OpenJPAPersistence
Date Tue, 08 Apr 2008 19:53:10 GMT

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.


Mime
View raw message