* This method will return null for non-EclipseLink EntityManagers.
*
* @see JpaEntityManagerFactory
*/
public static JpaEntityManagerFactory getEntityManagerFactory(javax.persistence.EntityManager em) {
JpaEntityManager entityManager = getEntityManager(em);
if (entityManager != null){
if (entityManager.getEntityManagerFactory() != null){
return ((EntityManagerFactoryDelegate)entityManager.getEntityManagerFactory()).getOwner();
}
}
return null;
}