Package org.apache.openjpa.persistence
Class JPAFacadeHelper
java.lang.Object
org.apache.openjpa.persistence.JPAFacadeHelper
Helper class for switching between OpenJPA's JPA facade and the underlying
Broker kernel.
- Since:
- 1.0.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectTranslate from a OpenJPA identity object to a Persistence one.static ClassfromOpenJPAObjectIdClass(Class oidClass) Translate from a OpenJPA identity class to a native one.static ClassMetaDatagetMetaData(jakarta.persistence.EntityManagerFactory emf, Class cls) Returns theClassMetaDataassociated with the persistent typecls.static ClassMetaDatagetMetaData(jakarta.persistence.EntityManager em, Class cls) Returns theClassMetaDataassociated with the persistent typecls.static ClassMetaDataReturns theClassMetaDataassociated with the persistent objecto.static BrokertoBroker(jakarta.persistence.EntityManager em) Return the underlying broker for the given entity manager facade.static BrokerFactorytoBrokerFactory(jakarta.persistence.EntityManagerFactory emf) Return the underlying broker factory for the given persistence manager factory facade.static OpenJPAEntityManagertoEntityManager(Broker broker) Return a persistence manager facade to the given broker retaining previously associated persistence context type.static OpenJPAEntityManagerFactorytoEntityManagerFactory(BrokerFactory factory) static ObjecttoOpenJPAObjectId(ClassMetaData meta, Object oid) Translate from a Persistence identity object to a OpenJPA one.static Object[]toOpenJPAObjectIds(ClassMetaData meta, Object... oids) Return an array of OpenJPA oids for the given native oid array.static Collection<Object>toOpenJPAObjectIds(ClassMetaData meta, Collection<Object> oids) Return a collection of OpenJPA oids for the given native oid collection.
-
Field Details
-
EM_KEY
- See Also:
-
EMF_KEY
- See Also:
-
-
Constructor Details
-
JPAFacadeHelper
public JPAFacadeHelper()
-
-
Method Details
-
toEntityManagerFactory
-
toBrokerFactory
Return the underlying broker factory for the given persistence manager factory facade. -
toEntityManager
Return a persistence manager facade to the given broker retaining previously associated persistence context type. -
toBroker
Return the underlying broker for the given entity manager facade. -
getMetaData
Returns theClassMetaDataassociated with the persistent objecto. -
getMetaData
Returns theClassMetaDataassociated with the persistent typecls. -
getMetaData
Returns theClassMetaDataassociated with the persistent typecls. -
fromOpenJPAObjectId
Translate from a OpenJPA identity object to a Persistence one. -
toOpenJPAObjectId
Translate from a Persistence identity object to a OpenJPA one. If the provided oid isn't of the expected type a UserException will be thrown. -
toOpenJPAObjectIds
Return an array of OpenJPA oids for the given native oid array. -
toOpenJPAObjectIds
Return a collection of OpenJPA oids for the given native oid collection. -
fromOpenJPAObjectIdClass
Translate from a OpenJPA identity class to a native one.
-