Top Description Inners Methods
org.hibernate.engine.spi

public Interface SessionFactoryImplementor

extends Mapping, SessionFactory, QueryParameterBindingTypeResolver
Known Direct Implementers
org.hibernate.internal.SessionFactoryImpl, org.hibernate.engine.spi.SessionFactoryDelegatingImpl
Imports
java.io.Serializable, java.util.List, .Map, .Set, javax.persistence.EntityGraph, org.hibernate.CustomEntityDirtinessStrategy, .EntityNameResolver, .HibernateException, .Interceptor, .MappingException, .Metamodel, .Session, .SessionFactory, .SessionFactoryObserver, org.hibernate.boot.model.relational.SqlStringGenerationContext, org.hibernate.boot.spi.SessionFactoryOptions, org.hibernate.cache.spi.CacheImplementor, org.hibernate.cfg.Settings, org.hibernate.context.spi.CurrentTenantIdentifierResolver, org.hibernate.dialect.Dialect, org.hibernate.dialect.function.SQLFunctionRegistry, org.hibernate.engine.ResultSetMappingDefinition, org.hibernate.engine.jdbc.spi.JdbcServices, .SqlExceptionHelper, org.hibernate.engine.profile.FetchProfile, org.hibernate.engine.query.spi.QueryPlanCache, org.hibernate.event.spi.EventEngine, org.hibernate.exception.spi.SQLExceptionConverter, org.hibernate.graph.spi.RootGraphImplementor, org.hibernate.id.IdentifierGenerator, org.hibernate.internal.FastSessionServices, org.hibernate.metamodel.spi.MetamodelImplementor, org.hibernate.persister.collection.CollectionPersister, org.hibernate.persister.entity.EntityPersister, org.hibernate.proxy.EntityNotFoundDelegate, org.hibernate.query.spi.NamedQueryRepository, .QueryParameterBindingTypeResolver, org.hibernate.service.spi.ServiceRegistryImplementor, org.hibernate.stat.spi.StatisticsImplementor, org.hibernate.type.Type, .TypeResolver

Deprecated

as a consequence of SessionFactory being deprecated. See corresponding docs for further information.

Defines the internal contract between the SessionFactory and other parts of Hibernate such as implementors of Type.
Authors
Gavin King, Steve Ebersole
See Also
org.hibernate.SessionFactory, org.hibernate.internal.SessionFactoryImpl

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
SessionFactoryImplementor.DeserializationResolver<T extends SessionFactoryImplementor>

Contract for resolving this SessionFactory on deserialization

Method Summary

Modifier and TypeMethod and Description
public void
public RootGraphImplementor<?>
public <T> List<RootGraphImplementor<? super T>>
public default <T> List<EntityGraph<? super T>>
findEntityGraphsByType(Class<T>
the entity type for which to find all EntityGraphs.
entityClass
)

Implements org.hibernate.jpa.HibernateEntityManagerFactory.findEntityGraphsByType.

Find all EntityGraphs associated with a given entity type.
public CacheImplementor
getCache()

Redeclares org.hibernate.SessionFactory.getCache.

Deprecated as a consequence of CacheImplementor being deprecated.
Obtain direct access to the underlying cache regions.
public default CollectionPersister
public default Map<String, CollectionPersister>
public default Set<String>

Returns:

set of all the collection roles in which the given entityName participates.
getCollectionRolesByEntityParticipant
(String
The entity name for which to get the collection roles.
entityName
)

Deprecated (since 5.2) Use MetamodelImplementor#collectionPersisters instead.
public CurrentTenantIdentifierResolver
public CustomEntityDirtinessStrategy
public SessionFactoryImplementor.DeserializationResolver<T extends SessionFactoryImplementor>
public default Dialect

Returns:

The dialect
getDialect
()

Deprecated (since 5.2) instead, use JdbcServices#getDialect()
Get the SQL dialect.
public EntityNotFoundDelegate
public default EntityPersister
getEntityPersister(String entityName)

Deprecated (since 5.2) Use MetamodelImplementor#entityPersister(Class) instead.
public default Map<String, EntityPersister>
getEntityPersisters()

Deprecated (since 5.2) Use MetamodelImplementor#entityPersisters instead.
public EventEngine
getEventEngine()

Get the EventEngine associated with this SessionFactory

public FastSessionServices

Returns:

the FastSessionServices instance associated with this SessionFactory
getFastSessionServices
()

public FetchProfile

Returns:

The profile definition
getFetchProfile
(String
The name of the profile to retrieve.
name
)

Retrieve fetch profile by name.

public IdentifierGenerator
getIdentifierGenerator(String rootEntityName)

Deprecated as a consequence of IdentifierGenerator being deprecated.
Get the identifier generator for the hierarchy
public default String[]
getImplementors(String entityName)

Get the names of all persistent classes that implement/extend the given interface/class
public default String
getImportedClassName(String name)

Get a class name, using query language imports
public Interceptor

Returns:

The factory scope interceptor, or null if none.
getInterceptor
()

Deprecated (since 5.2) if access to the SessionFactory-scoped Interceptor is needed, use SessionFactoryOptions#getInterceptor() instead.
Get the factory scoped interceptor for this factory.
public JdbcServices

Returns:

the JdbcServices
getJdbcServices
()

Get the JdbcServices.

public MetamodelImplementor
getMetamodel()

Redeclares javax.persistence.EntityManagerFactory.getMetamodel, org.hibernate.jpa.HibernateEntityManagerFactory.getMetamodel.

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

Returns:

The name for the SessionFactory
getName
()

Access to the name (if one) assigned to the SessionFactory

public default NamedQueryDefinition
public NamedQueryRepository

Returns:

The repository for named query definitions
getNamedQueryRepository
()

Deprecated (since 5.2) it will be replaced with the new QueryEngine concept introduced in 6.0
Provides access to the named query repository
public default NamedSQLQueryDefinition
getNamedSQLQuery(String queryName)

Deprecated (since 5.2) Use NamedQueryRepository#getNamedSQLQueryDefinition instead.
public QueryPlanCache

Returns:

The query plan cache
getQueryPlanCache
()

Deprecated (since 5.2) it will be replaced with the new QueryEngine concept introduced in 6.0
Access to the caches of HQL/JPQL and native query plans.
public default ResultSetMappingDefinition
public default String[]
getReturnAliases(String queryString)

Deprecated No replacement.
Get the return aliases of a query
public default Type[]
getReturnTypes(String queryString)

Deprecated No replacement.
Get the return types of a query
public ServiceRegistryImplementor

Returns:

The factory's ServiceRegistry
getServiceRegistry
()

Access to the ServiceRegistry for this SessionFactory.

public Settings
getSettings()

Deprecated since 5.0; use getSessionFactoryOptions() instead
public default SQLExceptionConverter

Returns:

The SQLExceptionConverter for this SessionFactory.
getSQLExceptionConverter
()

Retrieves the SQLExceptionConverter in effect for this SessionFactory.
public default SqlExceptionHelper

Returns:

The SqlExceptionHelper for this SessionFactory.
getSQLExceptionHelper
()

Deprecated since 5.0; use JdbcServices#getSqlExceptionHelper() instead as obtained from getServiceRegistry()
Retrieves the SqlExceptionHelper in effect for this SessionFactory.
public SQLFunctionRegistry
public SqlStringGenerationContext
public StatisticsImplementor
getStatistics()

Redeclares org.hibernate.SessionFactory.getStatistics.

Retrieve the statistics for this factory.
public default StatisticsImplementor
getStatisticsImplementor()

Deprecated (since 5.2) Just use getStatistics (with covariant return here as StatisticsImplementor).
public TypeResolver

Returns:

The type resolver
getTypeResolver
()

Deprecated (since 5.2) No replacement, access to and handling of Types will be much different in 6.0
Retrieve the Type resolver associated with this factory.
public String

Returns:

The UUID for this SessionFactory.
getUuid
()

Get the UUID for this SessionFactory.

public default Iterable<EntityNameResolver>
public default EntityPersister
locateEntityPersister(Class<T> byClass)

Deprecated (since 5.2) Use MetamodelImplementor#locateEntityPersister(Class) instead.
public default EntityPersister
public Session
openTemporarySession()

Deprecated as a consequence of Session being deprecated.
Get a non-transactional "current" session (used by hibernate-envers)
public default void
public default void
public SessionBuilderImplementor<T extends SessionBuilder<T extends SessionBuilder>>
Inherited from org.hibernate.engine.spi.Mapping:
getIdentifierGeneratorFactorygetIdentifierPropertyNamegetIdentifierTypegetReferencedPropertyType
Inherited from org.hibernate.query.spi.QueryParameterBindingTypeResolver:
resolveParameterBindTyperesolveParameterBindType
Inherited from org.hibernate.SessionFactory:
closecontainsFetchProfileDefinitiongetAllClassMetadatagetAllCollectionMetadatagetClassMetadatagetClassMetadatagetCollectionMetadatagetCurrentSessiongetDefinedFilterNamesgetFilterDefinitiongetSessionFactoryOptionsgetTypeHelperisClosedopenSessionopenStatelessSessionopenStatelessSessionwithStatelessOptions

Method Detail

addObserverback to summary
public void addObserver(SessionFactoryObserver observer)
findEntityGraphByNameback to summary
public RootGraphImplementor<?> findEntityGraphByName(String name)
findEntityGraphsByJavaTypeback to summary
public <T> List<RootGraphImplementor<? super T>> findEntityGraphsByJavaType(Class<T> entityClass)
findEntityGraphsByTypeback to summary
public default <T> List<EntityGraph<? super T>> findEntityGraphsByType(Class<T> entityClass)

Implements org.hibernate.jpa.HibernateEntityManagerFactory.findEntityGraphsByType.

Doc from org.hibernate.jpa.HibernateEntityManagerFactory.findEntityGraphsByType.

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.

Annotations
@Override
@SuppressWarnings:unchecked
getCacheback to summary
public CacheImplementor getCache()

Redeclares org.hibernate.SessionFactory.getCache.

Doc from org.hibernate.SessionFactory.getCache.

Deprecated

as a consequence of CacheImplementor being deprecated. See corresponding docs for further information.

Obtain direct access to the underlying cache regions.

Returns:CacheImplementor

The direct cache access API.

Annotations
@Override
getCollectionPersisterback to summary
public default CollectionPersister getCollectionPersister(String role) throws MappingException

Deprecated

(since 5.2) Use MetamodelImplementor#collectionPersister(String) instead.

Annotations
@Deprecated
getCollectionPersistersback to summary
public default Map<String, CollectionPersister> getCollectionPersisters()

Deprecated

(since 5.2) Use MetamodelImplementor#collectionPersisters instead.

Annotations
@Deprecated
getCollectionRolesByEntityParticipantback to summary
public default Set<String> getCollectionRolesByEntityParticipant(String entityName)

Deprecated

(since 5.2) Use MetamodelImplementor#collectionPersisters instead. Retrieves a set of all the collection roles in which the given entity is a participant, as either an index or an element.

Parameters
entityName:String

The entity name for which to get the collection roles.

Returns:Set<String>

set of all the collection roles in which the given entityName participates.

Annotations
@Deprecated
getCurrentTenantIdentifierResolverback to summary
public CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver()
getCustomEntityDirtinessStrategyback to summary
public CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy()
getDeserializationResolverback to summary
public SessionFactoryImplementor.DeserializationResolver<T extends SessionFactoryImplementor> getDeserializationResolver()
getDialectback to summary
public default Dialect getDialect()

Deprecated

(since 5.2) instead, use JdbcServices#getDialect()

Get the SQL dialect.

Shorthand for getJdbcServices().getDialect()

Returns:Dialect

The dialect

Annotations
@Deprecated
getEntityNotFoundDelegateback to summary
public EntityNotFoundDelegate getEntityNotFoundDelegate()
getEntityPersisterback to summary
public default EntityPersister getEntityPersister(String entityName) throws MappingException

Deprecated

(since 5.2) Use MetamodelImplementor#entityPersister(Class) instead.

Annotations
@Deprecated
getEntityPersistersback to summary
public default Map<String, EntityPersister> getEntityPersisters()

Deprecated

(since 5.2) Use MetamodelImplementor#entityPersisters instead.

Annotations
@Deprecated
getEventEngineback to summary
public EventEngine getEventEngine()

Get the EventEngine associated with this SessionFactory

getFastSessionServicesback to summary
public FastSessionServices getFastSessionServices()
Returns:FastSessionServices

the FastSessionServices instance associated with this SessionFactory

getFetchProfileback to summary
public FetchProfile getFetchProfile(String name)

Retrieve fetch profile by name.

Parameters
name:String

The name of the profile to retrieve.

Returns:FetchProfile

The profile definition

getIdentifierGeneratorback to summary
public IdentifierGenerator getIdentifierGenerator(String rootEntityName)

Deprecated

as a consequence of IdentifierGenerator being deprecated. See corresponding docs for further information.

Get the identifier generator for the hierarchy

getImplementorsback to summary
public default String[] getImplementors(String entityName)

Get the names of all persistent classes that implement/extend the given interface/class

Annotations
@Deprecated
getImportedClassNameback to summary
public default String getImportedClassName(String name)

Get a class name, using query language imports

Annotations
@Deprecated
getInterceptorback to summary
public Interceptor getInterceptor()

Deprecated

(since 5.2) if access to the SessionFactory-scoped Interceptor is needed, use SessionFactoryOptions#getInterceptor() instead. However, generally speaking this access is not needed.

Get the factory scoped interceptor for this factory.

Returns:Interceptor

The factory scope interceptor, or null if none.

Annotations
@Deprecated
getJdbcServicesback to summary
public JdbcServices getJdbcServices()

Get the JdbcServices.

Returns:JdbcServices

the JdbcServices

getMetamodelback to summary
public MetamodelImplementor getMetamodel()

Redeclares javax.persistence.EntityManagerFactory.getMetamodel, org.hibernate.jpa.HibernateEntityManagerFactory.getMetamodel.

Doc from javax.persistence.EntityManagerFactory.getMetamodel.

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

Returns:MetamodelImplementor

Metamodel instance

Annotations
@Override
getNameback to summary
public String getName()

Access to the name (if one) assigned to the SessionFactory

Returns:String

The name for the SessionFactory

getNamedQueryback to summary
public default NamedQueryDefinition getNamedQuery(String queryName)
Annotations
@Deprecated
getNamedQueryRepositoryback to summary
public NamedQueryRepository getNamedQueryRepository()

Deprecated

(since 5.2) it will be replaced with the new QueryEngine concept introduced in 6.0

Provides access to the named query repository

Returns:NamedQueryRepository

The repository for named query definitions

Annotations
@Deprecated
getNamedSQLQueryback to summary
public default NamedSQLQueryDefinition getNamedSQLQuery(String queryName)

Deprecated

(since 5.2) Use NamedQueryRepository#getNamedSQLQueryDefinition instead.

Annotations
@Deprecated
getQueryPlanCacheback to summary
public QueryPlanCache getQueryPlanCache()

Deprecated

(since 5.2) it will be replaced with the new QueryEngine concept introduced in 6.0

Access to the caches of HQL/JPQL and native query plans.

Returns:QueryPlanCache

The query plan cache

Annotations
@Deprecated
getResultSetMappingback to summary
public default ResultSetMappingDefinition getResultSetMapping(String name)

Deprecated

(since 5.2) Use NamedQueryRepository#getResultSetMappingDefinition instead.

Annotations
@Deprecated
getReturnAliasesback to summary
public default String[] getReturnAliases(String queryString)

Deprecated

No replacement.

Get the return aliases of a query

Annotations
@Deprecated
getReturnTypesback to summary
public default Type[] getReturnTypes(String queryString)

Deprecated

No replacement.

Get the return types of a query

Annotations
@Deprecated
getServiceRegistryback to summary
public ServiceRegistryImplementor getServiceRegistry()

Access to the ServiceRegistry for this SessionFactory.

Returns:ServiceRegistryImplementor

The factory's ServiceRegistry

getSettingsback to summary
public Settings getSettings()

Deprecated

since 5.0; use getSessionFactoryOptions() instead

Annotations
@Deprecated
@SuppressWarnings:deprecation
getSQLExceptionConverterback to summary
public default SQLExceptionConverter getSQLExceptionConverter()

Retrieves the SQLExceptionConverter in effect for this SessionFactory.

Returns:SQLExceptionConverter

The SQLExceptionConverter for this SessionFactory.

Annotations
@Deprecated
getSQLExceptionHelperback to summary
public default SqlExceptionHelper getSQLExceptionHelper()

Deprecated

since 5.0; use JdbcServices#getSqlExceptionHelper() instead as obtained from getServiceRegistry()

Retrieves the SqlExceptionHelper in effect for this SessionFactory.

Returns:SqlExceptionHelper

The SqlExceptionHelper for this SessionFactory.

Annotations
@Deprecated
getSqlFunctionRegistryback to summary
public SQLFunctionRegistry getSqlFunctionRegistry()
getSqlStringGenerationContextback to summary
public SqlStringGenerationContext getSqlStringGenerationContext()
getStatisticsback to summary
public StatisticsImplementor getStatistics()

Redeclares org.hibernate.SessionFactory.getStatistics.

Doc from org.hibernate.SessionFactory.getStatistics.

Retrieve the statistics for this factory.

Returns:StatisticsImplementor

The statistics.

Annotations
@Override
getStatisticsImplementorback to summary
public default StatisticsImplementor getStatisticsImplementor()

Deprecated

(since 5.2) Just use getStatistics (with covariant return here as StatisticsImplementor).

Annotations
@Deprecated
getTypeResolverback to summary
public TypeResolver getTypeResolver()

Deprecated

(since 5.2) No replacement, access to and handling of Types will be much different in 6.0

Retrieve the Type resolver associated with this factory.

Returns:TypeResolver

The type resolver

Annotations
@Deprecated
getUuidback to summary
public String getUuid()

Get the UUID for this SessionFactory. The value is generated as a java.util.UUID, but kept as a String.

Returns:String

The UUID for this SessionFactory.

See Also
org.hibernate.internal.SessionFactoryRegistry#getSessionFactory
iterateEntityNameResolversback to summary
public default Iterable<EntityNameResolver> iterateEntityNameResolvers()
Annotations
@Deprecated
locateEntityPersisterback to summary
public default EntityPersister locateEntityPersister(Class<T> byClass)

Deprecated

(since 5.2) Use MetamodelImplementor#locateEntityPersister(Class) instead.

Annotations
@Deprecated
locateEntityPersisterback to summary
public default EntityPersister locateEntityPersister(String byName)

Deprecated

(since 5.2) Use MetamodelImplementor#locateEntityPersister(String) instead.

Annotations
@Deprecated
openTemporarySessionback to summary
public Session openTemporarySession() throws HibernateException

Deprecated

as a consequence of Session being deprecated. See corresponding docs for further information.

Get a non-transactional "current" session (used by hibernate-envers)

registerNamedQueryDefinitionback to summary
public default void registerNamedQueryDefinition(String name, NamedQueryDefinition definition)

Deprecated

(since 5.2) Use NamedQueryRepository#registerNamedQueryDefinition instead.

Annotations
@Deprecated
registerNamedSQLQueryDefinitionback to summary
public default void registerNamedSQLQueryDefinition(String name, NamedSQLQueryDefinition definition)

Deprecated

(since 5.2) Use NamedQueryRepository#registerNamedSQLQueryDefinition instead.

Annotations
@Deprecated
withOptionsback to summary
public SessionBuilderImplementor<T extends SessionBuilder<T extends SessionBuilder>> withOptions()

Redeclares org.hibernate.SessionFactory.withOptions.

Doc from org.hibernate.SessionFactory.withOptions.

Obtain a Session builder.

Returns:SessionBuilderImplementor<T extends SessionBuilder<T extends SessionBuilder>>

The session builder

Annotations
@Override
org.hibernate.engine.spi back to summary

public Interface SessionFactoryImplementor.DeserializationResolver<T extends org.hibernate.engine.spi.SessionFactoryImplementor>

extends Serializable

Contract for resolving this SessionFactory on deserialization

Method Summary

Modifier and TypeMethod and Description
public T

Method Detail

resolveback to summary
public T resolve()