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 interface
SessionFactoryImplementor.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 void
addObserver(SessionFactoryObserver observer)
EntityGraph
findEntityGraphByName(java.lang.String name)
CacheImplementor
getCache()
Obtain direct access to the underlying cache regions.default CollectionPersister
getCollectionPersister(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.CurrentTenantIdentifierResolver
getCurrentTenantIdentifierResolver()
CustomEntityDirtinessStrategy
getCustomEntityDirtinessStrategy()
SessionFactoryImplementor.DeserializationResolver
getDeserializationResolver()
default Dialect
getDialect()
Deprecated.(since 5.2) instead, useJdbcServices.getDialect()
EntityNotFoundDelegate
getEntityNotFoundDelegate()
default EntityPersister
getEntityPersister(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.FetchProfile
getFetchProfile(java.lang.String name)
Retrieve fetch profile by name.IdentifierGenerator
getIdentifierGenerator(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.String
getImportedClassName(java.lang.String name)
Deprecated.UseMetamodel.getImportedClassName(java.lang.String)
insteadInterceptor
getInterceptor()
Deprecated.(since 5.2) if access to the SessionFactory-scoped Interceptor is needed, useSessionFactoryOptions.getInterceptor()
instead.JdbcServices
getJdbcServices()
Get the JdbcServices.MetamodelImplementor
getMetamodel()
java.lang.String
getName()
Access to the name (if one) assigned to the SessionFactorydefault NamedQueryDefinition
getNamedQuery(java.lang.String queryName)
Deprecated.(since 5.2) UseNamedQueryRepository.getNamedQueryDefinition(java.lang.String)
instead.NamedQueryRepository
getNamedQueryRepository()
Deprecated.(since 5.2) it will be replaced with the new QueryEngine concept introduced in 6.0default NamedSQLQueryDefinition
getNamedSQLQuery(java.lang.String queryName)
Deprecated.(since 5.2) UseNamedQueryRepository.getNamedSQLQueryDefinition(java.lang.String)
instead.QueryPlanCache
getQueryPlanCache()
Deprecated.(since 5.2) it will be replaced with the new QueryEngine concept introduced in 6.0default ResultSetMappingDefinition
getResultSetMapping(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.ServiceRegistryImplementor
getServiceRegistry()
Access to the ServiceRegistry for this SessionFactory.Settings
getSettings()
Deprecated.since 5.0; useSessionFactory.getSessionFactoryOptions()
insteaddefault SQLExceptionConverter
getSQLExceptionConverter()
Deprecated.since 5.0; useJdbcServices.getSqlExceptionHelper()
->SqlExceptionHelper.getSqlExceptionConverter()
instead as obtained fromgetServiceRegistry()
default SqlExceptionHelper
getSQLExceptionHelper()
Deprecated.since 5.0; useJdbcServices.getSqlExceptionHelper()
instead as obtained fromgetServiceRegistry()
SQLFunctionRegistry
getSqlFunctionRegistry()
StatisticsImplementor
getStatistics()
Retrieve the statistics fopr this factory.default StatisticsImplementor
getStatisticsImplementor()
Deprecated.(since 5.2) Just usegetStatistics()
(with covariant return here asStatisticsImplementor
).TypeResolver
getTypeResolver()
Deprecated.(since 5.2) No replacement, access to and handling of Types will be much different in 6.0java.lang.String
getUuid()
Get the UUID for this SessionFactory.default java.lang.Iterable<EntityNameResolver>
iterateEntityNameResolvers()
Deprecated.(since 5.2) usegetMetamodel()
->MetamodelImplementor.getEntityNameResolvers()
default EntityPersister
locateEntityPersister(java.lang.Class byClass)
Deprecated.(since 5.2) UseMetamodelImplementor.locateEntityPersister(Class)
instead.default EntityPersister
locateEntityPersister(java.lang.String byName)
Deprecated.(since 5.2) UseMetamodelImplementor.locateEntityPersister(String)
instead.Session
openTemporarySession()
Get a non-transactional "current" session (used by hibernate-envers)default void
registerNamedQueryDefinition(java.lang.String name, NamedQueryDefinition definition)
Deprecated.default void
registerNamedSQLQueryDefinition(java.lang.String name, NamedSQLQueryDefinition definition)
Deprecated.SessionBuilderImplementor
withOptions()
Obtain aSession
builder.-
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
findEntityGraphsByType, 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:SessionFactory
Obtain aSession
builder.- Specified by:
withOptions
in 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: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 fopr this factory.- Specified by:
getStatistics
in interfaceSessionFactory
- Returns:
- The statistics.
-
getServiceRegistry
ServiceRegistryImplementor getServiceRegistry()
Access to the ServiceRegistry for this SessionFactory.- Returns:
- The factory's ServiceRegistry
-
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 cachres 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 theType
resolver 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()
-
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
-
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:
getMetamodel
in interfaceEntityManagerFactory
- Specified by:
getMetamodel
in interfaceHibernateEntityManagerFactory
-
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
-
findEntityGraphByName
EntityGraph findEntityGraphByName(java.lang.String name)
-
-