Package org.hibernate.engine.spi
Interface SessionFactoryImplementor
- All Superinterfaces:
AutoCloseable,Closeable,EntityManagerFactory,Mapping,QueryParameterBindingTypeResolver,Referenceable,Serializable,SessionFactory,SqlAstCreationContext,SqmCreationContext
- All Known Implementing Classes:
SessionFactoryDelegatingImpl,SessionFactoryImpl
public interface SessionFactoryImplementor
extends Mapping, SessionFactory, SqmCreationContext, SqlAstCreationContext, QueryParameterBindingTypeResolver
Defines the internal contract between the
SessionFactory and the internal
implementation of Hibernate.- Author:
- Gavin King, Steve Ebersole
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceDeprecated, for removal: This API element is subject to removal in a future version.this is no longer used -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObserver(SessionFactoryObserver observer) bestGuessEntityName(Object object) The best guess entity name for an entity not in an associationfindEntityGraphByName(String name) Return the rootEntityGraphwith the given name, ornullif there is no graph with the given name.getCache()Obtain direct access to the underlying cache regions.Deprecated, for removal: This API element is subject to removal in a future version.this is never calledGet 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) Get the identifier generator for the hierarchygetIdentifierGenerator(String rootEntityName) Deprecated.Get the JdbcServices.default MappingMetamodelImplementorThe runtime MappingMetamodelImplementorDeprecated.no longer for internal use, usegetMappingMetamodel()orSqmCreationContext.getJpaMetamodel()getName()Access to the name (if one) assigned to the SessionFactoryAccess to the ServiceRegistry for this SessionFactory.default SessionFactoryImplementorThe 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 this SessionFactory.OverridesSessionFactory.openSession()to widen the return type: this is useful for internal code depending onSessionFactoryImplementoras it would otherwise need to frequently resort to casting to the internal contract.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.Obtain a session builder for creating newSessions with certain customized options.Methods inherited from interface jakarta.persistence.EntityManagerFactory
addNamedEntityGraph, addNamedQuery, createEntityManager, createEntityManager, createEntityManager, createEntityManager, getPersistenceUnitUtil, getProperties, isOpen, unwrapMethods inherited from interface org.hibernate.engine.spi.Mapping
getIdentifierPropertyName, getIdentifierType, getReferencedPropertyTypeMethods inherited from interface javax.naming.Referenceable
getReferenceMethods inherited from interface org.hibernate.SessionFactory
close, containsFetchProfileDefinition, findEntityGraphsByType, fromSession, fromStatelessSession, fromStatelessTransaction, fromTransaction, getCurrentSession, getDefinedFetchProfileNames, getDefinedFilterNames, getSchemaManager, inSession, inStatelessSession, inStatelessTransaction, inTransaction, isClosed, openStatelessSession, openStatelessSession, withStatelessOptionsMethods inherited from interface org.hibernate.sql.ast.spi.SqlAstCreationContext
getMaximumFetchDepthMethods inherited from interface org.hibernate.query.sqm.spi.SqmCreationContext
getJpaMetamodel, getNodeBuilder
-
Method Details
-
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:
-
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 onSessionFactoryImplementoras it would otherwise need to frequently resort to casting to the internal contract.- Specified by:
openSessionin interfaceSessionFactory- Returns:
- the opened Session.
-
getTypeConfiguration
TypeConfiguration getTypeConfiguration()- Specified by:
getTypeConfigurationin interfaceQueryParameterBindingTypeResolver- Specified by:
getTypeConfigurationin interfaceSqmCreationContext
-
getSessionFactory
Description copied from interface:SqlAstCreationContextThe SessionFactory- Specified by:
getSessionFactoryin interfaceSqlAstCreationContext
-
getMappingMetamodel
Description copied from interface:SqlAstCreationContextThe runtime MappingMetamodelImplementor- Specified by:
getMappingMetamodelin interfaceQueryParameterBindingTypeResolver- Specified by:
getMappingMetamodelin interfaceSqlAstCreationContext
-
getQueryEngine
QueryEngine getQueryEngine()- Specified by:
getQueryEnginein interfaceSqmCreationContext
-
getCriteriaBuilder
HibernateCriteriaBuilder getCriteriaBuilder()Description copied from interface:SessionFactory- Specified by:
getCriteriaBuilderin interfaceEntityManagerFactory- Specified by:
getCriteriaBuilderin interfaceSessionFactory- Returns:
- CriteriaBuilder instance
- See Also:
-
withOptions
SessionBuilderImplementor withOptions()Description copied from interface:SessionFactoryObtain a session builder for creating newSessions with certain customized options.- Specified by:
withOptionsin interfaceSessionFactory- Returns:
- The session builder
-
openTemporarySession
Get a non-transactional "current" session (used by hibernate-envers)- Throws:
HibernateException
-
getCache
CacheImplementor getCache()Description copied from interface:SessionFactoryObtain direct access to the underlying cache regions.- Specified by:
getCachein interfaceEntityManagerFactory- Specified by:
getCachein interfaceSessionFactory- Returns:
- The direct cache access API.
-
getStatistics
StatisticsImplementor getStatistics()Description copied from interface:SessionFactoryRetrieve the statistics for this factory.- Specified by:
getStatisticsin interfaceSessionFactory- Returns:
- The statistics.
-
getRuntimeMetamodels
RuntimeMetamodelsImplementor getRuntimeMetamodels() -
getServiceRegistry
ServiceRegistryImplementor getServiceRegistry()Access to the ServiceRegistry for this SessionFactory.- Specified by:
getServiceRegistryin interfaceSqlAstCreationContext- Specified by:
getServiceRegistryin interfaceSqmCreationContext- 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
Get 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 SessionFactory
-
getWrapperOptions
WrapperOptions getWrapperOptions() -
getSessionFactoryOptions
SessionFactoryOptions getSessionFactoryOptions()Description copied from interface:SessionFactoryGet the options used to build this factory.- Specified by:
getSessionFactoryOptionsin interfaceSessionFactory- Returns:
- The special options used to build the factory.
-
getFilterDefinition
Description copied from interface:SessionFactoryObtain the definition of a filter by name.- Specified by:
getFilterDefinitionin 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
Description copied from interface:SessionFactoryReturn the rootEntityGraphwith the given name, ornullif there is no graph with the given name.- Specified by:
findEntityGraphByNamein 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 -
getIdentifierGenerator
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.no longer for internal use, usegetMappingMetamodel()orSqmCreationContext.getJpaMetamodel()Description copied from interface:EntityManagerFactoryReturn an instance ofMetamodelinterface for access to the metamodel of the persistence unit.- Specified by:
getMetamodelin interfaceEntityManagerFactory- Returns:
- Metamodel instance
-
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:
resolveParameterBindTypein 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:
resolveParameterBindTypein interfaceQueryParameterBindingTypeResolver
-