Package org.hibernate.engine.spi
Interface SessionFactoryImplementor
-
- All Superinterfaces:
AutoCloseable
,Closeable
,EntityManagerFactory
,Mapping
,QueryParameterBindingTypeResolver
,Referenceable
,Serializable
,SessionFactory
,SqlAstCreationContext
,SqmCreationContext
- All Known Implementing Classes:
MockSessionFactory
,ProcessorSessionFactory
,SessionFactoryDelegatingImpl
,SessionFactoryImpl
public interface SessionFactoryImplementor extends Mapping, SessionFactory, SqmCreationContext, SqlAstCreationContext, QueryParameterBindingTypeResolver
Defines the internal contract between theSessionFactory
and the internal implementation of Hibernate.- See Also:
SessionFactory
,SessionFactoryImpl
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SessionFactoryImplementor.DeserializationResolver<T extends SessionFactoryImplementor>
Deprecated, for removal: This API element is subject to removal in a future version.this is no longer used
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
addObserver(SessionFactoryObserver observer)
String
bestGuessEntityName(Object object)
The best guess entity name for an entity not in an associationRootGraphImplementor<?>
findEntityGraphByName(String name)
Return the rootEntityGraph
with the given name, ornull
if there is no graph with the given name.Collection<FilterDefinition>
getAutoEnabledFilters()
CacheImplementor
getCache()
Obtain direct access to the underlying cache regions.HibernateCriteriaBuilder
getCriteriaBuilder()
CurrentTenantIdentifierResolver<Object>
getCurrentTenantIdentifierResolver()
CustomEntityDirtinessStrategy
getCustomEntityDirtinessStrategy()
SessionFactoryImplementor.DeserializationResolver<?>
getDeserializationResolver()
Deprecated, for removal: This API element is subject to removal in a future version.this is never calledEntityNotFoundDelegate
getEntityNotFoundDelegate()
EventEngine
getEventEngine()
Get the EventEngine associated with this SessionFactoryFastSessionServices
getFastSessionServices()
FetchProfile
getFetchProfile(String name)
Retrieve fetch profile by name.FilterDefinition
getFilterDefinition(String filterName)
Obtain the definition of a filter by name.Generator
getGenerator(String rootEntityName)
Get the identifier generator for the hierarchyIdentifierGenerator
getIdentifierGenerator(String rootEntityName)
Deprecated.JdbcServices
getJdbcServices()
Get the JdbcServices.default MappingMetamodelImplementor
getMappingMetamodel()
The runtime MappingMetamodelImplementorMetamodelImplementor
getMetamodel()
Deprecated.no longer for internal use, usegetMappingMetamodel()
orSqmCreationContext.getJpaMetamodel()
String
getName()
Access to the name (if one) assigned to the SessionFactoryQueryEngine
getQueryEngine()
RuntimeMetamodelsImplementor
getRuntimeMetamodels()
ServiceRegistryImplementor
getServiceRegistry()
Access to the ServiceRegistry for this SessionFactory.default SessionFactoryImplementor
getSessionFactory()
The SessionFactorySessionFactoryOptions
getSessionFactoryOptions()
Get the options used to build this factory.SqlStringGenerationContext
getSqlStringGenerationContext()
StatisticsImplementor
getStatistics()
Retrieve the statistics for this factory.JavaType<Object>
getTenantIdentifierJavaType()
The java type to use for a tenant identifier.TypeConfiguration
getTypeConfiguration()
String
getUuid()
Get the UUID for this SessionFactory.WrapperOptions
getWrapperOptions()
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.SessionImplementor
openTemporarySession()
Get a non-transactional "current" session (used by hibernate-envers)<T> BindableType<T>
resolveParameterBindType(Class<T> clazz)
Deprecated, for removal: This API element is subject to removal in a future version.<T> BindableType<? super T>
resolveParameterBindType(T bindValue)
Deprecated, for removal: This API element is subject to removal in a future version.SessionBuilderImplementor
withOptions()
Obtain a session builder for creating newSession
s with certain customized options.-
Methods inherited from interface jakarta.persistence.EntityManagerFactory
addNamedEntityGraph, addNamedQuery, createEntityManager, createEntityManager, createEntityManager, createEntityManager, getPersistenceUnitUtil, getProperties, isOpen, unwrap
-
Methods inherited from interface org.hibernate.engine.spi.Mapping
getIdentifierPropertyName, getIdentifierType, getReferencedPropertyType
-
Methods inherited from interface javax.naming.Referenceable
getReference
-
Methods inherited from interface org.hibernate.SessionFactory
close, containsFetchProfileDefinition, findEntityGraphsByType, fromSession, fromStatelessSession, fromStatelessTransaction, fromTransaction, getCurrentSession, getDefinedFetchProfileNames, getDefinedFilterNames, 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
getJpaMetamodel, getNodeBuilder
-
-
-
-
Method Detail
-
getUuid
String getUuid()
Get the UUID for this SessionFactory.The value is generated as a
UUID
, but kept as a String.- Returns:
- The UUID for this SessionFactory.
- See Also:
SessionFactoryRegistry.getSessionFactory(java.lang.String)
-
getName
String getName()
Access to the name (if one) assigned to the SessionFactory- 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 interfaceQueryParameterBindingTypeResolver
- Specified by:
getTypeConfiguration
in interfaceSqmCreationContext
-
getSessionFactory
default SessionFactoryImplementor getSessionFactory()
Description copied from interface:SqlAstCreationContext
The SessionFactory- Specified by:
getSessionFactory
in interfaceSqlAstCreationContext
-
getMappingMetamodel
default MappingMetamodelImplementor getMappingMetamodel()
Description copied from interface:SqlAstCreationContext
The runtime MappingMetamodelImplementor- Specified by:
getMappingMetamodel
in interfaceQueryParameterBindingTypeResolver
- Specified by:
getMappingMetamodel
in interfaceSqlAstCreationContext
-
getQueryEngine
QueryEngine getQueryEngine()
- Specified by:
getQueryEngine
in interfaceSqmCreationContext
-
getCriteriaBuilder
HibernateCriteriaBuilder getCriteriaBuilder()
Description copied from interface:SessionFactory
- Specified by:
getCriteriaBuilder
in interfaceEntityManagerFactory
- Specified by:
getCriteriaBuilder
in interfaceSessionFactory
- See Also:
SharedSessionContract.getCriteriaBuilder()
-
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() throws HibernateException
Get a non-transactional "current" session (used by hibernate-envers)- Throws:
HibernateException
-
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 the ServiceRegistry for this SessionFactory.- Specified by:
getServiceRegistry
in interfaceSqlAstCreationContext
- Specified by:
getServiceRegistry
in interfaceSqmCreationContext
- Returns:
- The factory's ServiceRegistry
-
getEventEngine
EventEngine getEventEngine()
Get the EventEngine associated with this SessionFactory
-
getFetchProfile
FetchProfile getFetchProfile(String name)
Retrieve fetch profile by name.- Parameters:
name
- The name of the profile to retrieve.- Returns:
- The profile definition
-
getGenerator
Generator getGenerator(String rootEntityName)
Get the identifier generator for the hierarchy
-
getEntityNotFoundDelegate
EntityNotFoundDelegate getEntityNotFoundDelegate()
-
addObserver
void addObserver(SessionFactoryObserver observer)
-
getCustomEntityDirtinessStrategy
CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy()
-
getCurrentTenantIdentifierResolver
CurrentTenantIdentifierResolver<Object> getCurrentTenantIdentifierResolver()
-
getTenantIdentifierJavaType
JavaType<Object> getTenantIdentifierJavaType()
The java type to use for a tenant identifier.- Since:
- 6.4
-
getFastSessionServices
FastSessionServices getFastSessionServices()
- Returns:
- the FastSessionServices instance associated with this SessionFactory
-
getWrapperOptions
WrapperOptions getWrapperOptions()
-
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
FilterDefinition getFilterDefinition(String filterName)
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()
Get the JdbcServices.- Returns:
- the JdbcServices
-
getSqlStringGenerationContext
SqlStringGenerationContext getSqlStringGenerationContext()
-
findEntityGraphByName
RootGraphImplementor<?> findEntityGraphByName(String name)
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:
EntityManagerFactory.addNamedEntityGraph(java.lang.String, jakarta.persistence.EntityGraph<T>)
-
bestGuessEntityName
String bestGuessEntityName(Object object)
The best guess entity name for an entity not in an association
-
getIdentifierGenerator
@Deprecated(since="6.2") IdentifierGenerator getIdentifierGenerator(String rootEntityName)
Deprecated.Get the identifier generator for the hierarchy
-
getDeserializationResolver
@Deprecated(since="6.2", forRemoval=true) SessionFactoryImplementor.DeserializationResolver<?> getDeserializationResolver()
Deprecated, for removal: This API element is subject to removal in a future version.this is never called
-
getMetamodel
@Deprecated MetamodelImplementor getMetamodel()
Deprecated.no longer for internal use, usegetMappingMetamodel()
orSqmCreationContext.getJpaMetamodel()
- Specified by:
getMetamodel
in interfaceEntityManagerFactory
-
resolveParameterBindType
@Deprecated(since="6.2", forRemoval=true) <T> BindableType<? super T> resolveParameterBindType(T bindValue)
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
resolveParameterBindType
in interfaceQueryParameterBindingTypeResolver
-
resolveParameterBindType
@Deprecated(since="6.2", forRemoval=true) <T> BindableType<T> resolveParameterBindType(Class<T> clazz)
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
resolveParameterBindType
in interfaceQueryParameterBindingTypeResolver
-
-