Top Description Inners Methods
org.hibernate.engine.spi

public Interface SessionFactoryImplementor

extends Mapping, SessionFactory, SqmCreationContext, SqlAstCreationContext, QueryParameterBindingTypeResolver
Known Direct Implementers
org.hibernate.internal.SessionFactoryImpl, org.hibernate.engine.spi.SessionFactoryDelegatingImpl
Imports
java.io.Serializable, org.hibernate.CustomEntityDirtinessStrategy, .HibernateException, .SessionFactory, .SessionFactoryObserver, org.hibernate.boot.model.relational.SqlStringGenerationContext, org.hibernate.boot.spi.SessionFactoryOptions, org.hibernate.cache.spi.CacheImplementor, org.hibernate.context.spi.CurrentTenantIdentifierResolver, org.hibernate.engine.jdbc.spi.JdbcServices, org.hibernate.engine.profile.FetchProfile, org.hibernate.event.spi.EventEngine, org.hibernate.graph.spi.RootGraphImplementor, org.hibernate.id.IdentifierGenerator, org.hibernate.internal.FastSessionServices, org.hibernate.metamodel.spi.MappingMetamodelImplementor, .MetamodelImplementor, .RuntimeMetamodelsImplementor, org.hibernate.proxy.EntityNotFoundDelegate, org.hibernate.query.BindableType, org.hibernate.query.criteria.HibernateCriteriaBuilder, org.hibernate.query.spi.QueryEngine, .QueryParameterBindingTypeResolver, org.hibernate.query.sqm.spi.SqmCreationContext, org.hibernate.service.spi.ServiceRegistryImplementor, org.hibernate.sql.ast.spi.SqlAstCreationContext, org.hibernate.stat.spi.StatisticsImplementor, org.hibernate.generator.Generator, org.hibernate.type.descriptor.WrapperOptions, org.hibernate.type.descriptor.java.JavaType, org.hibernate.type.spi.TypeConfiguration

Deprecated

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

Defines the internal contract between the SessionFactory and the internal implementation of Hibernate.
Authors
Gavin King, Steve Ebersole
See Also
SessionFactory, org.hibernate.internal.SessionFactoryImpl

Nested and Inner Type Summary

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

Deprecated for removal since 6.2. this is no longer used
Contract for resolving this SessionFactory on deserialization

Method Summary

Modifier and TypeMethod and Description
public void
public String
bestGuessEntityName(Object object)

The best guess entity name for an entity not in an association

public RootGraphImplementor<?>
findEntityGraphByName(String name)

Redeclares org.hibernate.SessionFactory.findEntityGraphByName.

Return the root EntityGraph with the given name, or null if there is no graph with the given name.
public CacheImplementor
getCache()

Redeclares org.hibernate.SessionFactory.getCache.

Obtain direct access to the underlying cache regions.
public HibernateCriteriaBuilder
public CurrentTenantIdentifierResolver<Object>
public CustomEntityDirtinessStrategy
public SessionFactoryImplementor.DeserializationResolver<?>
getDeserializationResolver()

Deprecated for removal since 6.2. this is never called
public EntityNotFoundDelegate
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 FilterDefinition
getFilterDefinition(String
The name of the filter for which to obtain the definition.
filterName
)

Redeclares org.hibernate.SessionFactory.getFilterDefinition.

Obtain the definition of a filter by name.
public Generator
getGenerator(String rootEntityName)

Get the identifier generator for the hierarchy

public IdentifierGenerator
getIdentifierGenerator(String rootEntityName)

Deprecated since 6.2. use getGenerator(String)
Get the identifier generator for the hierarchy
public JdbcServices

Returns:

the JdbcServices
getJdbcServices
()

Get the JdbcServices.

public default MappingMetamodelImplementor
public MetamodelImplementor
getMetamodel()

Redeclares jakarta.persistence.EntityManagerFactory.getMetamodel.

Deprecated no longer for internal use, use getMappingMetamodel() or getJpaMetamodel()
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 QueryEngine
public RuntimeMetamodelsImplementor
public ServiceRegistryImplementor

Returns:

The factory's ServiceRegistry
getServiceRegistry
()

Redeclares org.hibernate.sql.ast.spi.SqlAstCreationContext.getServiceRegistry.

Redeclares as abstract: org.hibernate.query.sqm.spi.SqmCreationContext.getServiceRegistry.

Access to the ServiceRegistry for this SessionFactory.
public default SessionFactoryImplementor
getSessionFactory()

Implements org.hibernate.sql.ast.spi.SqlAstCreationContext.getSessionFactory.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
The SessionFactory
public SessionFactoryOptions
public SqlStringGenerationContext
public StatisticsImplementor
getStatistics()

Redeclares org.hibernate.SessionFactory.getStatistics.

Retrieve the statistics for this factory.
public JavaType<Object>
getTenantIdentifierJavaType()

The java type to use for a tenant identifier.

public TypeConfiguration
public String

Returns:

The UUID for this SessionFactory.
getUuid
()

Get the UUID for this SessionFactory.

public WrapperOptions
public SessionImplementor

Returns:

the opened Session.
openSession
()

Redeclares org.hibernate.SessionFactory.openSession.

Overrides SessionFactory#openSession() to widen the return type: this is useful for internal code depending on SessionFactoryImplementor as it would otherwise need to frequently resort to casting to the internal contract.
public SessionImplementor
openTemporarySession()

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

public <T> BindableType<? super T>
public <T> BindableType<T>
public SessionBuilderImplementor
withOptions()

Redeclares org.hibernate.SessionFactory.withOptions.

Obtain a session builder for creating new Sessions with certain customized options.
Inherited from org.hibernate.engine.spi.Mapping:
getIdentifierPropertyNamegetIdentifierTypegetReferencedPropertyType
Inherited from org.hibernate.query.sqm.spi.SqmCreationContext:
getJpaMetamodelgetNodeBuilder
Inherited from org.hibernate.SessionFactory:
closecontainsFetchProfileDefinitionfindEntityGraphsByTypefromSessionfromStatelessSessionfromStatelessTransactionfromTransactiongetCurrentSessiongetDefinedFetchProfileNamesgetDefinedFilterNamesgetSchemaManagerinSessioninStatelessSessioninStatelessTransactioninTransactionisClosedopenStatelessSessionopenStatelessSessionwithStatelessOptions
Inherited from org.hibernate.sql.ast.spi.SqlAstCreationContext:
getMaximumFetchDepth

Method Detail

addObserverback to summary
public void addObserver(SessionFactoryObserver observer)
bestGuessEntityNameback to summary
public String bestGuessEntityName(Object object)

The best guess entity name for an entity not in an association

findEntityGraphByNameback to summary
public RootGraphImplementor<?> findEntityGraphByName(String name)

Redeclares org.hibernate.SessionFactory.findEntityGraphByName.

Doc from org.hibernate.SessionFactory.findEntityGraphByName.

Return the root EntityGraph with the given name, or null if there is no graph with the given name.

Parameters
name:String

the name given to some jakarta.persistence.NamedEntityGraph

Returns:RootGraphImplementor<?>

an instance of RootGraph

getCacheback to summary
public CacheImplementor getCache()

Redeclares org.hibernate.SessionFactory.getCache.

Doc from org.hibernate.SessionFactory.getCache.

Obtain direct access to the underlying cache regions.

Returns:CacheImplementor

The direct cache access API.

Annotations
@Override
getCriteriaBuilderback to summary
public HibernateCriteriaBuilder getCriteriaBuilder()

Redeclares org.hibernate.SessionFactory.getCriteriaBuilder.

Doc from org.hibernate.SessionFactory.getCriteriaBuilder.

Obtain a HibernateCriteriaBuilder which may be used to construct criteria queries.

Returns:HibernateCriteriaBuilder

Doc from jakarta.persistence.EntityManagerFactory.getCriteriaBuilder.

CriteriaBuilder instance

Annotations
@Override
getCurrentTenantIdentifierResolverback to summary
public CurrentTenantIdentifierResolver<Object> getCurrentTenantIdentifierResolver()
getCustomEntityDirtinessStrategyback to summary
public CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy()
getDeserializationResolverback to summary
public SessionFactoryImplementor.DeserializationResolver<?> getDeserializationResolver()

Deprecated

for removal since 6.2.

this is never called

Annotations
@Deprecated
since:6.2
forRemoval:true
getEntityNotFoundDelegateback to summary
public EntityNotFoundDelegate getEntityNotFoundDelegate()
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

getFilterDefinitionback to summary
public FilterDefinition getFilterDefinition(String filterName)

Redeclares org.hibernate.SessionFactory.getFilterDefinition.

Doc from org.hibernate.SessionFactory.getFilterDefinition.

Obtain the definition of a filter by name.

Parameters
filterName:String

The name of the filter for which to obtain the definition.

Returns:FilterDefinition

The filter definition.

getGeneratorback to summary
public Generator getGenerator(String rootEntityName)

Get the identifier generator for the hierarchy

getIdentifierGeneratorback to summary
public IdentifierGenerator getIdentifierGenerator(String rootEntityName)

Deprecated

since 6.2.

use getGenerator(String)

Get the identifier generator for the hierarchy

Annotations
@Deprecated
since:6.2
getJdbcServicesback to summary
public JdbcServices getJdbcServices()

Get the JdbcServices.

Returns:JdbcServices

the JdbcServices

getMappingMetamodelback to summary
public default MappingMetamodelImplementor getMappingMetamodel()

Implements org.hibernate.sql.ast.spi.SqlAstCreationContext.getMappingMetamodel, org.hibernate.query.spi.QueryParameterBindingTypeResolver.getMappingMetamodel.

Doc from org.hibernate.sql.ast.spi.SqlAstCreationContext.getMappingMetamodel.

The runtime MappingMetamodelImplementor

Annotations
@Override
getMetamodelback to summary
public MetamodelImplementor getMetamodel()

Redeclares jakarta.persistence.EntityManagerFactory.getMetamodel.

Doc from jakarta.persistence.EntityManagerFactory.getMetamodel.

Deprecated

no longer for internal use, use getMappingMetamodel() or getJpaMetamodel()

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

Returns:MetamodelImplementor

Metamodel instance

Annotations
@Override
@Deprecated
getNameback to summary
public String getName()

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

Returns:String

The name for the SessionFactory

getQueryEngineback to summary
public QueryEngine getQueryEngine()

Redeclares org.hibernate.query.sqm.spi.SqmCreationContext.getQueryEngine.

getRuntimeMetamodelsback to summary
public RuntimeMetamodelsImplementor getRuntimeMetamodels()
getServiceRegistryback to summary
public ServiceRegistryImplementor getServiceRegistry()

Redeclares org.hibernate.sql.ast.spi.SqlAstCreationContext.getServiceRegistry.

Redeclares as abstract: org.hibernate.query.sqm.spi.SqmCreationContext.getServiceRegistry.

Access to the ServiceRegistry for this SessionFactory.

Returns:ServiceRegistryImplementor

The factory's ServiceRegistry

getSessionFactoryback to summary
public default SessionFactoryImplementor getSessionFactory()

Implements org.hibernate.sql.ast.spi.SqlAstCreationContext.getSessionFactory.

Doc from org.hibernate.sql.ast.spi.SqlAstCreationContext.getSessionFactory.

Deprecated

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

The SessionFactory

getSessionFactoryOptionsback to summary
public SessionFactoryOptions getSessionFactoryOptions()

Redeclares org.hibernate.SessionFactory.getSessionFactoryOptions.

Doc from org.hibernate.SessionFactory.getSessionFactoryOptions.

Get the options used to build this factory.

Returns:SessionFactoryOptions

The special options used to build the factory.

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
getTenantIdentifierJavaTypeback to summary
public JavaType<Object> getTenantIdentifierJavaType()

The java type to use for a tenant identifier.

Since
6.4
getTypeConfigurationback to summary
public TypeConfiguration getTypeConfiguration()

Redeclares org.hibernate.query.spi.QueryParameterBindingTypeResolver.getTypeConfiguration.

Redeclares as abstract: org.hibernate.query.sqm.spi.SqmCreationContext.getTypeConfiguration.

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
getWrapperOptionsback to summary
public WrapperOptions getWrapperOptions()
openSessionback to summary
public SessionImplementor openSession()

Redeclares org.hibernate.SessionFactory.openSession.

Overrides SessionFactory#openSession() to widen the return type: this is useful for internal code depending on SessionFactoryImplementor as it would otherwise need to frequently resort to casting to the internal contract.

Returns:SessionImplementor

the opened Session.

Annotations
@Override
openTemporarySessionback to summary
public SessionImplementor openTemporarySession() throws HibernateException

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

resolveParameterBindTypeback to summary
public <T> BindableType<? super T> resolveParameterBindType(T bindValue)

Redeclares org.hibernate.query.spi.QueryParameterBindingTypeResolver.resolveParameterBindType.

Annotations
@Override
@Deprecated
since:6.2
forRemoval:true
resolveParameterBindTypeback to summary
public <T> BindableType<T> resolveParameterBindType(Class<T> clazz)

Redeclares org.hibernate.query.spi.QueryParameterBindingTypeResolver.resolveParameterBindType, org.hibernate.query.spi.QueryParameterBindingTypeResolver.resolveParameterBindType.

Annotations
@Override
@Deprecated
since:6.2
forRemoval:true
withOptionsback to summary
public SessionBuilderImplementor withOptions()

Redeclares org.hibernate.SessionFactory.withOptions.

Doc from org.hibernate.SessionFactory.withOptions.

Obtain a session builder for creating new Sessions with certain customized options.

Returns:SessionBuilderImplementor

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
Annotations
@Deprecated
since:6.2
forRemoval:true

Deprecated

for removal since 6.2.

this is no longer used

Contract for resolving this SessionFactory on deserialization

Method Summary

Modifier and TypeMethod and Description
public T

Method Detail

resolveback to summary
public T resolve()