Package org.hibernate.engine.spi
Interface SessionFactoryImplementor
- All Superinterfaces:
AutoCloseable
,BindingContext
,EntityManagerFactory
,MappingContext
,QueryParameterBindingTypeResolver
,Referenceable
,Serializable
,SessionFactory
,SqlAstCreationContext
,SqmCreationContext
- All Known Implementing Classes:
MockSessionFactory
,ProcessorSessionFactory
,SessionFactoryDelegatingImpl
,SessionFactoryImpl
public interface SessionFactoryImplementor
extends MappingContext, SessionFactory, SqmCreationContext, SqlAstCreationContext, QueryParameterBindingTypeResolver
Defines the internal contract between the
SessionFactory
and the internal
implementation of Hibernate.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addObserver
(SessionFactoryObserver observer) bestGuessEntityName
(Object object) The best guess entity name for an entity not in an associationfindEntityGraphByName
(String name) Return the rootEntityGraph
with the given name, ornull
if there is no graph with the given name.getCache()
Obtain direct access to the underlying cache regions.Get the EventEngine associated with this SessionFactorygetFetchProfile
(String name) Retrieve fetch profile by name.getFilterDefinition
(String filterName) Obtain the definition of a filter by name.getGenerator
(String rootEntityName) Deprecated, for removal: This API element is subject to removal in a future version.Only used in one place, will be removeddefault MappingMetamodelImplementor
The runtime MappingMetamodelImplementorgetName()
Access to the name (if one) assigned to theSessionFactory
Access to theServiceRegistry
for thisSessionFactory
.default SessionFactoryImplementor
The SessionFactoryGet the options used to build this factory.Retrieve the statistics for this factory.The java type to use for a tenant identifier.getUuid()
Get the UUID for thisSessionFactory
.Return an instance ofWrapperOptions
which is not backed by a session, and whose functionality is therefore incomplete.OverridesSessionFactory.openSession()
to widen the return type: this is useful for internal code depending onSessionFactoryImplementor
as it would otherwise need to frequently resort to casting to the internal contract.Get a non-transactional "current" session (used by hibernate-envers)Obtain a session builder for creating newSession
s with certain customized options.Methods inherited from interface org.hibernate.query.BindingContext
getJpaMetamodel
Methods inherited from interface jakarta.persistence.EntityManagerFactory
addNamedEntityGraph, addNamedQuery, callInTransaction, getMetamodel, getNamedEntityGraphs, getNamedQueries, getPersistenceUnitUtil, getProperties, getTransactionType, isOpen, runInTransaction, unwrap
Methods inherited from interface org.hibernate.type.MappingContext
getIdentifierPropertyName, getIdentifierType, getReferencedPropertyType
Methods inherited from interface org.hibernate.query.spi.QueryParameterBindingTypeResolver
resolveParameterBindType, resolveParameterBindType
Methods inherited from interface javax.naming.Referenceable
getReference
Methods inherited from interface org.hibernate.SessionFactory
close, containsFetchProfileDefinition, createEntityManager, createEntityManager, createEntityManager, createEntityManager, findEntityGraphsByType, fromSession, fromStatelessSession, fromStatelessTransaction, fromTransaction, getCriteriaBuilder, getCurrentSession, getDefinedFetchProfileNames, getDefinedFilterNames, getJndiName, getSchemaManager, inSession, inStatelessSession, inStatelessTransaction, inTransaction, isClosed, openStatelessSession, openStatelessSession, withStatelessOptions
Methods inherited from interface org.hibernate.sql.ast.spi.SqlAstCreationContext
getMaximumFetchDepth
Methods inherited from interface org.hibernate.query.sqm.spi.SqmCreationContext
classForName, getNodeBuilder, getQueryEngine
-
Method Details
-
getUuid
String getUuid()Get the UUID for thisSessionFactory
.The value is generated as a
UUID
, but kept as a String.- Returns:
- The UUID for this
SessionFactory
. - See Also:
-
getName
String getName()Access to the name (if one) assigned to theSessionFactory
- Specified by:
getName
in interfaceEntityManagerFactory
- Returns:
- The name for the
SessionFactory
-
openSession
SessionImplementor openSession()OverridesSessionFactory.openSession()
to widen the return type: this is useful for internal code depending onSessionFactoryImplementor
as it would otherwise need to frequently resort to casting to the internal contract.- Specified by:
openSession
in interfaceSessionFactory
- Returns:
- the opened
Session
.
-
getTypeConfiguration
TypeConfiguration getTypeConfiguration()- Specified by:
getTypeConfiguration
in interfaceBindingContext
- Specified by:
getTypeConfiguration
in interfaceQueryParameterBindingTypeResolver
-
getSessionFactory
Description copied from interface:SqlAstCreationContext
The SessionFactory- Specified by:
getSessionFactory
in interfaceSqlAstCreationContext
-
getMappingMetamodel
Description copied from interface:SqlAstCreationContext
The runtime MappingMetamodelImplementor- Specified by:
getMappingMetamodel
in interfaceBindingContext
- Specified by:
getMappingMetamodel
in interfaceQueryParameterBindingTypeResolver
- Specified by:
getMappingMetamodel
in interfaceSqlAstCreationContext
-
withOptions
SessionBuilderImplementor withOptions()Description copied from interface:SessionFactory
Obtain a session builder for creating newSession
s with certain customized options.- Specified by:
withOptions
in interfaceSessionFactory
- Returns:
- The session builder
-
openTemporarySession
SessionImplementor openTemporarySession()Get a non-transactional "current" session (used by hibernate-envers) -
getCache
CacheImplementor getCache()Description copied from interface:SessionFactory
Obtain direct access to the underlying cache regions.- Specified by:
getCache
in interfaceEntityManagerFactory
- Specified by:
getCache
in interfaceSessionFactory
- Returns:
- The direct cache access API.
-
getStatistics
StatisticsImplementor getStatistics()Description copied from interface:SessionFactory
Retrieve the statistics for this factory.- Specified by:
getStatistics
in interfaceSessionFactory
- Returns:
- The statistics.
-
getRuntimeMetamodels
RuntimeMetamodelsImplementor getRuntimeMetamodels() -
getServiceRegistry
ServiceRegistryImplementor getServiceRegistry()Access to theServiceRegistry
for thisSessionFactory
.- Returns:
- The factory's ServiceRegistry
-
getEventEngine
EventEngine getEventEngine()Get the EventEngine associated with this SessionFactory -
getFetchProfile
Retrieve fetch profile by name.- Parameters:
name
- The name of the profile to retrieve.- Returns:
- The profile definition
-
getGenerator
Deprecated, for removal: This API element is subject to removal in a future version.Only used in one place, will be removedGet the identifier generator for the hierarchy -
getEntityNotFoundDelegate
EntityNotFoundDelegate getEntityNotFoundDelegate() -
addObserver
-
getCustomEntityDirtinessStrategy
CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy() -
getCurrentTenantIdentifierResolver
CurrentTenantIdentifierResolver<Object> getCurrentTenantIdentifierResolver() -
getTenantIdentifierJavaType
The java type to use for a tenant identifier.- Since:
- 6.4
-
getFastSessionServices
FastSessionServices getFastSessionServices()- Returns:
- the
FastSessionServices
instance associated with this factory
-
getWrapperOptions
WrapperOptions getWrapperOptions()Return an instance ofWrapperOptions
which is not backed by a session, and whose functionality is therefore incomplete.- API Note:
- Avoid using this operation.
-
getSessionFactoryOptions
SessionFactoryOptions getSessionFactoryOptions()Description copied from interface:SessionFactory
Get the options used to build this factory.- Specified by:
getSessionFactoryOptions
in interfaceSessionFactory
- Returns:
- The special options used to build the factory.
-
getFilterDefinition
Description copied from interface:SessionFactory
Obtain the definition of a filter by name.- Specified by:
getFilterDefinition
in interfaceSessionFactory
- Parameters:
filterName
- The name of the filter for which to obtain the definition.- Returns:
- The filter definition.
-
getAutoEnabledFilters
Collection<FilterDefinition> getAutoEnabledFilters() -
getJdbcServices
JdbcServices getJdbcServices() -
getSqlStringGenerationContext
SqlStringGenerationContext getSqlStringGenerationContext() -
findEntityGraphByName
Description copied from interface:SessionFactory
Return the rootEntityGraph
with the given name, ornull
if there is no graph with the given name.- Specified by:
findEntityGraphByName
in interfaceSessionFactory
- Parameters:
name
- the name given to someNamedEntityGraph
- Returns:
- an instance of
RootGraph
- See Also:
-
bestGuessEntityName
The best guess entity name for an entity not in an association
-