Top Description Methods
org.hibernate.jpa

public Interface HibernateEntityManagerFactory

extends EntityManagerFactory, Serializable
Known Direct Subinterfaces
org.hibernate.SessionFactory, org.hibernate.ejb.HibernateEntityManagerFactory
Annotations
@Deprecated
Imports
java.io.Serializable, java.util.List, javax.persistence.EntityGraph, .EntityManagerFactory, javax.persistence.metamodel.EntityType, org.hibernate.Metamodel, org.hibernate.boot.spi.SessionFactoryOptions, org.hibernate.cfg.AvailableSettings, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.internal.log.DeprecationLogger, org.hibernate.internal.util.NullnessHelper

Deprecated

(since 5.2) Use SessionFactory (or SessionFactoryImplementor) as it now extends EntityManagerFactory directly

Contract giving access to the underlying org.hibernate.SessionFactory from an javax.persistence.EntityManagerFactory
Author
Gavin King

Method Summary

Modifier and TypeMethod and Description
public <T> List<EntityGraph<? super T>>

Returns:

A list of EntityGraph instances associated with the given entity type. The empty list is returned in case there are not entity graphs.
findEntityGraphsByType
(Class<T>
the entity type for which to find all EntityGraphs.
entityClass
)

Find all EntityGraphs associated with a given entity type.

public default String

Returns:

the name of the factory.
getEntityManagerFactoryName
()

Deprecated - no longer necessary.
Returns the name of the factory.
public default EntityType<X>

Returns:

the EntityType for the specified name
getEntityTypeByName
(String
entity name
entityName
)

Deprecated Use org.hibernate.MetamodelImplementor#getEntityTypeByName instead.
Find an entity type by name
public Metamodel
getMetamodel()

Redeclares javax.persistence.EntityManagerFactory.getMetamodel.

Return an instance of Metamodel interface for access to the metamodel of the persistence unit.
public default SessionFactoryImplementor

Returns:

The underlying Hibernate SessionFactory
getSessionFactory
()

Deprecated The expectation is that SessionFactory implementors also implement EntityManagerFactory; so this call really should just return this
Obtain the underlying Hibernate SessionFactory.
Inherited from javax.persistence.EntityManagerFactory:
addNamedEntityGraphaddNamedQueryclosecreateEntityManagercreateEntityManagercreateEntityManagercreateEntityManagergetCachegetCriteriaBuildergetPersistenceUnitUtilgetPropertiesisOpenunwrap

Method Detail

findEntityGraphsByTypeback to summary
public <T> List<EntityGraph<? super T>> findEntityGraphsByType(Class<T> entityClass)

Find all EntityGraphs associated with a given entity type.

Parameters
entityClass:Class<T>

the entity type for which to find all EntityGraphs.

Returns:List<EntityGraph<? super T>>

A list of EntityGraph instances associated with the given entity type. The empty list is returned in case there are not entity graphs.

getEntityManagerFactoryNameback to summary
public default String getEntityManagerFactoryName()

Deprecated

- no longer necessary. all references can be directly replaced with calls to SessionFactoryOptions#getSessionFactoryName() via getSessionFactory() -> SessionFactoryImplementor#getSessionFactoryOptions()

Returns the name of the factory. The name is either can be specified via the property hibernate.ejb.entitymanager_factory_name. If the property is not set the persistence unit name is used. If persistence unit name is not available, a unique name will be generated.

Returns:String

the name of the factory.

Annotations
@Deprecated
getEntityTypeByNameback to summary
public default EntityType<X> getEntityTypeByName(String entityName)

Deprecated

Use org.hibernate.MetamodelImplementor#getEntityTypeByName instead.

Find an entity type by name

Parameters
entityName:String

entity name

Returns:EntityType<X>

the EntityType for the specified name

Annotations
@Deprecated
getMetamodelback to summary
public Metamodel getMetamodel()

Redeclares javax.persistence.EntityManagerFactory.getMetamodel.

Doc from javax.persistence.EntityManagerFactory.getMetamodel.

Return an instance of Metamodel interface for access to the metamodel of the persistence unit.

Returns:Metamodel

Metamodel instance

Annotations
@Override
getSessionFactoryback to summary
public default SessionFactoryImplementor getSessionFactory()

Deprecated

The expectation is that SessionFactory implementors also implement EntityManagerFactory; so this call really should just return this

Obtain the underlying Hibernate SessionFactory.

Returns:SessionFactoryImplementor

The underlying Hibernate SessionFactory

Annotations
@Deprecated