Package org.hibernate.engine.spi
Interface SessionFactoryImplementor
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable,EntityManagerFactory,HibernateEntityManagerFactory,Mapping,QueryParameterBindingTypeResolver,javax.naming.Referenceable,java.io.Serializable,SessionFactory
- All Known Implementing Classes:
SessionFactoryDelegatingImpl
public interface SessionFactoryImplementor extends Mapping, SessionFactory, QueryParameterBindingTypeResolver
Defines the internal contract between the SessionFactory and other parts of Hibernate such as implementors of Type.- See Also:
SessionFactory,SessionFactoryImpl
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSessionFactoryImplementor.DeserializationResolver<T extends SessionFactoryImplementor>Contract for resolving this SessionFactory on deserialization
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidaddObserver(SessionFactoryObserver observer)RootGraphImplementor<?>findEntityGraphByName(java.lang.String name)<T> java.util.List<RootGraphImplementor<? super T>>findEntityGraphsByJavaType(java.lang.Class<T> entityClass)default <T> java.util.List<EntityGraph<? super T>>findEntityGraphsByType(java.lang.Class<T> entityClass)Find allEntityGraphs associated with a given entity type.CacheImplementorgetCache()Obtain direct access to the underlying cache regions.default CollectionPersistergetCollectionPersister(java.lang.String role)Deprecated.(since 5.2) UseMetamodelImplementor.collectionPersister(String)instead.default java.util.Map<java.lang.String,CollectionPersister>getCollectionPersisters()Deprecated.(since 5.2) UseMetamodelImplementor.collectionPersisters()instead.default java.util.Set<java.lang.String>getCollectionRolesByEntityParticipant(java.lang.String entityName)Deprecated.(since 5.2) UseMetamodelImplementor.collectionPersisters()instead.CurrentTenantIdentifierResolvergetCurrentTenantIdentifierResolver()CustomEntityDirtinessStrategygetCustomEntityDirtinessStrategy()SessionFactoryImplementor.DeserializationResolvergetDeserializationResolver()default DialectgetDialect()Deprecated.(since 5.2) instead, useJdbcServices.getDialect()EntityNotFoundDelegategetEntityNotFoundDelegate()default EntityPersistergetEntityPersister(java.lang.String entityName)Deprecated.(since 5.2) UseMetamodelImplementor.entityPersister(Class)instead.default java.util.Map<java.lang.String,EntityPersister>getEntityPersisters()Deprecated.(since 5.2) UseMetamodelImplementor.entityPersisters()instead.EventEnginegetEventEngine()Get the EventEngine associated with this SessionFactoryorg.hibernate.internal.FastSessionServicesgetFastSessionServices()FetchProfilegetFetchProfile(java.lang.String name)Retrieve fetch profile by name.IdentifierGeneratorgetIdentifierGenerator(java.lang.String rootEntityName)Get the identifier generator for the hierarchydefault java.lang.String[]getImplementors(java.lang.String entityName)Deprecated.UseMetamodel.getImplementors(java.lang.String)insteaddefault java.lang.StringgetImportedClassName(java.lang.String name)Deprecated.UseMetamodel.getImportedClassName(java.lang.String)insteadInterceptorgetInterceptor()Deprecated.(since 5.2) if access to the SessionFactory-scoped Interceptor is needed, useSessionFactoryOptions.getInterceptor()instead.JdbcServicesgetJdbcServices()Get the JdbcServices.MetamodelImplementorgetMetamodel()java.lang.StringgetName()Access to the name (if one) assigned to the SessionFactorydefault NamedQueryDefinitiongetNamedQuery(java.lang.String queryName)Deprecated.(since 5.2) UseNamedQueryRepository.getNamedQueryDefinition(java.lang.String)instead.NamedQueryRepositorygetNamedQueryRepository()Deprecated.(since 5.2) it will be replaced with the new QueryEngine concept introduced in 6.0default NamedSQLQueryDefinitiongetNamedSQLQuery(java.lang.String queryName)Deprecated.(since 5.2) UseNamedQueryRepository.getNamedSQLQueryDefinition(java.lang.String)instead.QueryPlanCachegetQueryPlanCache()Deprecated.(since 5.2) it will be replaced with the new QueryEngine concept introduced in 6.0default ResultSetMappingDefinitiongetResultSetMapping(java.lang.String name)Deprecated.(since 5.2) UseNamedQueryRepository.getResultSetMappingDefinition(java.lang.String)instead.default java.lang.String[]getReturnAliases(java.lang.String queryString)Deprecated.No replacement.default Type[]getReturnTypes(java.lang.String queryString)Deprecated.No replacement.ServiceRegistryImplementorgetServiceRegistry()Access to the ServiceRegistry for this SessionFactory.SettingsgetSettings()Deprecated.since 5.0; useSessionFactory.getSessionFactoryOptions()insteaddefault SQLExceptionConvertergetSQLExceptionConverter()Deprecated.since 5.0; useJdbcServices.getSqlExceptionHelper()->SqlExceptionHelper.getSqlExceptionConverter()instead as obtained fromgetServiceRegistry()default SqlExceptionHelpergetSQLExceptionHelper()Deprecated.since 5.0; useJdbcServices.getSqlExceptionHelper()instead as obtained fromgetServiceRegistry()SQLFunctionRegistrygetSqlFunctionRegistry()SqlStringGenerationContextgetSqlStringGenerationContext()StatisticsImplementorgetStatistics()Retrieve the statistics for this factory.default StatisticsImplementorgetStatisticsImplementor()Deprecated.(since 5.2) Just usegetStatistics()(with covariant return here asStatisticsImplementor).TypeResolvergetTypeResolver()Deprecated.(since 5.2) No replacement, access to and handling of Types will be much different in 6.0java.lang.StringgetUuid()Get the UUID for this SessionFactory.default java.lang.Iterable<EntityNameResolver>iterateEntityNameResolvers()Deprecated.(since 5.2) usegetMetamodel()->MetamodelImplementor.getEntityNameResolvers()default EntityPersisterlocateEntityPersister(java.lang.Class byClass)Deprecated.(since 5.2) UseMetamodelImplementor.locateEntityPersister(Class)instead.default EntityPersisterlocateEntityPersister(java.lang.String byName)Deprecated.(since 5.2) UseMetamodelImplementor.locateEntityPersister(String)instead.SessionopenTemporarySession()Get a non-transactional "current" session (used by hibernate-envers)default voidregisterNamedQueryDefinition(java.lang.String name, NamedQueryDefinition definition)Deprecated.default voidregisterNamedSQLQueryDefinition(java.lang.String name, NamedSQLQueryDefinition definition)Deprecated.SessionBuilderImplementorwithOptions()Obtain aSessionbuilder.-
Methods inherited from interface javax.persistence.EntityManagerFactory
addNamedEntityGraph, addNamedQuery, createEntityManager, createEntityManager, createEntityManager, createEntityManager, getCriteriaBuilder, getPersistenceUnitUtil, getProperties, isOpen, unwrap
-
Methods inherited from interface org.hibernate.jpa.HibernateEntityManagerFactory
getEntityManagerFactoryName, getEntityTypeByName, getSessionFactory
-
Methods inherited from interface org.hibernate.engine.spi.Mapping
getIdentifierGeneratorFactory, getIdentifierPropertyName, getIdentifierType, getReferencedPropertyType
-
Methods inherited from interface org.hibernate.query.spi.QueryParameterBindingTypeResolver
resolveParameterBindType, resolveParameterBindType
-
Methods inherited from interface org.hibernate.SessionFactory
close, containsFetchProfileDefinition, getAllClassMetadata, getAllCollectionMetadata, getClassMetadata, getClassMetadata, getCollectionMetadata, getCurrentSession, getDefinedFilterNames, getFilterDefinition, getSessionFactoryOptions, getTypeHelper, isClosed, openSession, openStatelessSession, openStatelessSession, withStatelessOptions
-
-
-
-
Method Detail
-
getUuid
java.lang.String getUuid()
Get the UUID for this SessionFactory. The value is generated as aUUID, but kept as a String.- Returns:
- The UUID for this SessionFactory.
- See Also:
SessionFactoryRegistry.getSessionFactory(java.lang.String)
-
getName
java.lang.String getName()
Access to the name (if one) assigned to the SessionFactory- Returns:
- The name for the SessionFactory
-
withOptions
SessionBuilderImplementor withOptions()
Description copied from interface:SessionFactoryObtain aSessionbuilder.- Specified by:
withOptionsin interfaceSessionFactory- Returns:
- The session builder
-
openTemporarySession
Session openTemporarySession() throws HibernateException
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.
-
getServiceRegistry
ServiceRegistryImplementor getServiceRegistry()
Access to the ServiceRegistry for this SessionFactory.- Returns:
- The factory's ServiceRegistry
-
getEventEngine
EventEngine getEventEngine()
Get the EventEngine associated with this SessionFactory
-
getInterceptor
@Deprecated Interceptor getInterceptor()
Deprecated.(since 5.2) if access to the SessionFactory-scoped Interceptor is needed, useSessionFactoryOptions.getInterceptor()instead. However, generally speaking this access is not needed.Get the factory scoped interceptor for this factory.- Returns:
- The factory scope interceptor, or null if none.
-
getQueryPlanCache
@Deprecated QueryPlanCache getQueryPlanCache()
Deprecated.(since 5.2) it will be replaced with the new QueryEngine concept introduced in 6.0Access to the caches of HQL/JPQL and native query plans.- Returns:
- The query plan cache
-
getNamedQueryRepository
@Deprecated NamedQueryRepository getNamedQueryRepository()
Deprecated.(since 5.2) it will be replaced with the new QueryEngine concept introduced in 6.0Provides access to the named query repository- Returns:
- The repository for named query definitions
-
getFetchProfile
FetchProfile getFetchProfile(java.lang.String name)
Retrieve fetch profile by name.- Parameters:
name- The name of the profile to retrieve.- Returns:
- The profile definition
-
getTypeResolver
@Deprecated TypeResolver getTypeResolver()
Deprecated.(since 5.2) No replacement, access to and handling of Types will be much different in 6.0Retrieve theTyperesolver associated with this factory.- Returns:
- The type resolver
-
getIdentifierGenerator
IdentifierGenerator getIdentifierGenerator(java.lang.String rootEntityName)
Get the identifier generator for the hierarchy
-
getEntityNotFoundDelegate
EntityNotFoundDelegate getEntityNotFoundDelegate()
-
getSqlFunctionRegistry
SQLFunctionRegistry getSqlFunctionRegistry()
-
addObserver
void addObserver(SessionFactoryObserver observer)
-
getCustomEntityDirtinessStrategy
CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy()
-
getCurrentTenantIdentifierResolver
CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver()
-
iterateEntityNameResolvers
@Deprecated default java.lang.Iterable<EntityNameResolver> iterateEntityNameResolvers()
Deprecated.(since 5.2) usegetMetamodel()->MetamodelImplementor.getEntityNameResolvers()
-
getFastSessionServices
org.hibernate.internal.FastSessionServices getFastSessionServices()
- Returns:
- the FastSessionServices instance associated with this SessionFactory
-
getDeserializationResolver
SessionFactoryImplementor.DeserializationResolver getDeserializationResolver()
-
getReturnTypes
@Deprecated default Type[] getReturnTypes(java.lang.String queryString)
Deprecated.No replacement.Get the return types of a query
-
getReturnAliases
@Deprecated default java.lang.String[] getReturnAliases(java.lang.String queryString)
Deprecated.No replacement.Get the return aliases of a query
-
getStatisticsImplementor
@Deprecated default StatisticsImplementor getStatisticsImplementor()
Deprecated.(since 5.2) Just usegetStatistics()(with covariant return here asStatisticsImplementor).
-
getNamedQuery
@Deprecated default NamedQueryDefinition getNamedQuery(java.lang.String queryName)
Deprecated.(since 5.2) UseNamedQueryRepository.getNamedQueryDefinition(java.lang.String)instead.
-
registerNamedQueryDefinition
@Deprecated default void registerNamedQueryDefinition(java.lang.String name, NamedQueryDefinition definition)Deprecated.
-
getNamedSQLQuery
@Deprecated default NamedSQLQueryDefinition getNamedSQLQuery(java.lang.String queryName)
Deprecated.(since 5.2) UseNamedQueryRepository.getNamedSQLQueryDefinition(java.lang.String)instead.
-
registerNamedSQLQueryDefinition
@Deprecated default void registerNamedSQLQueryDefinition(java.lang.String name, NamedSQLQueryDefinition definition)Deprecated.
-
getResultSetMapping
@Deprecated default ResultSetMappingDefinition getResultSetMapping(java.lang.String name)
Deprecated.(since 5.2) UseNamedQueryRepository.getResultSetMappingDefinition(java.lang.String)instead.
-
getJdbcServices
JdbcServices getJdbcServices()
Get the JdbcServices.- Returns:
- the JdbcServices
-
getDialect
@Deprecated default Dialect getDialect()
Deprecated.(since 5.2) instead, useJdbcServices.getDialect()Get the SQL dialect. Shorthand forgetJdbcServices().getDialect()- Returns:
- The dialect
-
getSqlStringGenerationContext
SqlStringGenerationContext getSqlStringGenerationContext()
-
getSQLExceptionConverter
@Deprecated default SQLExceptionConverter getSQLExceptionConverter()
Deprecated.since 5.0; useJdbcServices.getSqlExceptionHelper()->SqlExceptionHelper.getSqlExceptionConverter()instead as obtained fromgetServiceRegistry()Retrieves the SQLExceptionConverter in effect for this SessionFactory.- Returns:
- The SQLExceptionConverter for this SessionFactory.
-
getSQLExceptionHelper
@Deprecated default SqlExceptionHelper getSQLExceptionHelper()
Deprecated.since 5.0; useJdbcServices.getSqlExceptionHelper()instead as obtained fromgetServiceRegistry()Retrieves the SqlExceptionHelper in effect for this SessionFactory.- Returns:
- The SqlExceptionHelper for this SessionFactory.
-
getSettings
@Deprecated Settings getSettings()
Deprecated.since 5.0; useSessionFactory.getSessionFactoryOptions()instead
-
getMetamodel
MetamodelImplementor getMetamodel()
- Specified by:
getMetamodelin interfaceEntityManagerFactory- Specified by:
getMetamodelin interfaceHibernateEntityManagerFactory
-
findEntityGraphsByType
default <T> java.util.List<EntityGraph<? super T>> findEntityGraphsByType(java.lang.Class<T> entityClass)
Description copied from interface:HibernateEntityManagerFactoryFind allEntityGraphs associated with a given entity type.- Specified by:
findEntityGraphsByTypein interfaceHibernateEntityManagerFactory- Parameters:
entityClass- the entity type for which to find allEntityGraphs.- Returns:
- A list of
EntityGraphinstances associated with the given entity type. The empty list is returned in case there are not entity graphs.
-
findEntityGraphsByJavaType
<T> java.util.List<RootGraphImplementor<? super T>> findEntityGraphsByJavaType(java.lang.Class<T> entityClass)
-
findEntityGraphByName
RootGraphImplementor<?> findEntityGraphByName(java.lang.String name)
-
getEntityPersister
@Deprecated default EntityPersister getEntityPersister(java.lang.String entityName) throws MappingException
Deprecated.(since 5.2) UseMetamodelImplementor.entityPersister(Class)instead.- Throws:
MappingException
-
getEntityPersisters
@Deprecated default java.util.Map<java.lang.String,EntityPersister> getEntityPersisters()
Deprecated.(since 5.2) UseMetamodelImplementor.entityPersisters()instead.
-
getCollectionPersister
@Deprecated default CollectionPersister getCollectionPersister(java.lang.String role) throws MappingException
Deprecated.(since 5.2) UseMetamodelImplementor.collectionPersister(String)instead.- Throws:
MappingException
-
getCollectionPersisters
@Deprecated default java.util.Map<java.lang.String,CollectionPersister> getCollectionPersisters()
Deprecated.(since 5.2) UseMetamodelImplementor.collectionPersisters()instead.
-
getCollectionRolesByEntityParticipant
@Deprecated default java.util.Set<java.lang.String> getCollectionRolesByEntityParticipant(java.lang.String entityName)
Deprecated.(since 5.2) UseMetamodelImplementor.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- The entity name for which to get the collection roles.- Returns:
- set of all the collection roles in which the given entityName participates.
-
locateEntityPersister
@Deprecated default EntityPersister locateEntityPersister(java.lang.Class byClass)
Deprecated.(since 5.2) UseMetamodelImplementor.locateEntityPersister(Class)instead.
-
locateEntityPersister
@Deprecated default EntityPersister locateEntityPersister(java.lang.String byName)
Deprecated.(since 5.2) UseMetamodelImplementor.locateEntityPersister(String)instead.
-
getImplementors
@Deprecated default java.lang.String[] getImplementors(java.lang.String entityName)
Deprecated.UseMetamodel.getImplementors(java.lang.String)insteadGet the names of all persistent classes that implement/extend the given interface/class
-
getImportedClassName
@Deprecated default java.lang.String getImportedClassName(java.lang.String name)
Deprecated.UseMetamodel.getImportedClassName(java.lang.String)insteadGet a class name, using query language imports
-
-