public class JpaHelper
extends java.lang.Object
Constructor and Description |
---|
JpaHelper() |
Modifier and Type | Method and Description |
---|---|
static EntityManagerFactory |
createEntityManagerFactory(Server session)
Create a EclipseLink EMF given a ServerSession that has already been created
and logged in.
|
static EntityManagerFactory |
createEntityManagerFactory(java.lang.String sessionName)
Create a EclipseLink EMF using a session name and sessions.xml.
|
static Query |
createQuery(DatabaseQuery query,
EntityManager em)
Create a EclipseLink JPA query dynamically given a EclipseLink query.
|
static DatabaseQuery |
getDatabaseQuery(Query query)
Access the internal EclipseLink query wrapped within the JPA query.
|
static DatabaseSession |
getDatabaseSession(EntityManagerFactory emf)
Retrieve the shared database session from the EMF.
|
static JpaEntityManager |
getEntityManager(EntityManager entityManager)
Convert a JPA entityManager into a EclipseLink specific one.
|
static JpaEntityManagerFactory |
getEntityManagerFactory(EntityManager em)
Given an EntityManager return the EntityManagerFactory that created it.
|
static JpaEntityManagerFactory |
getEntityManagerFactory(EntityManagerFactory emf)
Given a JPA EntityManagerFactory attempt to cast it to a EclipseLink EMF.
|
static org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl |
getEntityManagerFactory(org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl emf)
Deprecated.
|
static ReadAllQuery |
getReadAllQuery(Query query)
Access the internal EclipseLink query wrapped within the JPA query.
|
static ReportQuery |
getReportQuery(Query query)
Access the internal EclipseLink query wrapped within the JPA query.
|
static Server |
getServerSession(EntityManagerFactory emf)
Retrieve the shared server session from the EMF.
|
static SessionBroker |
getSessionBroker(EntityManagerFactory emf)
Retrieve the shared session broker from the EMF.
|
static boolean |
isEclipseLink(EntityManager em)
Verify if the JPA provider is EclipseLink.
|
static boolean |
isEclipseLink(EntityManagerFactory emf)
Verify if the JPA provider is EclipseLink
|
static boolean |
isEclipseLink(Query query)
Verify if the JPA provider is EclipseLink
|
static boolean |
isReportQuery(Query query)
Determine if the JPA query is a EclipseLink ReportQuery.
|
static void |
loadUnfetchedObject(FetchGroupTracker entity)
If the object has a fetch group then the whole object is read in.
|
public static boolean isEclipseLink(EntityManager em)
public static boolean isEclipseLink(EntityManagerFactory emf)
public static boolean isEclipseLink(Query query)
public static boolean isReportQuery(Query query)
public static ReportQuery getReportQuery(Query query)
getReadAllQuery(javax.persistence.Query)
public static DatabaseQuery getDatabaseQuery(Query query)
public static ReadAllQuery getReadAllQuery(Query query)
public static Query createQuery(DatabaseQuery query, EntityManager em)
public static JpaEntityManager getEntityManager(EntityManager entityManager)
public static org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl getEntityManagerFactory(org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl emf)
JpaEntityManagerFactory
public static JpaEntityManagerFactory getEntityManagerFactory(EntityManagerFactory emf)
JpaEntityManagerFactory
public static JpaEntityManagerFactory getEntityManagerFactory(EntityManager em)
JpaEntityManagerFactory
public static DatabaseSession getDatabaseSession(EntityManagerFactory emf)
public static Server getServerSession(EntityManagerFactory emf)
public static SessionBroker getSessionBroker(EntityManagerFactory emf)
public static EntityManagerFactory createEntityManagerFactory(Server session)
public static EntityManagerFactory createEntityManagerFactory(java.lang.String sessionName)
public static void loadUnfetchedObject(FetchGroupTracker entity)