Package org.hibernate.engine.spi
Interface SessionFactoryImplementor
-
- All Superinterfaces:
AutoCloseable
,Closeable
,EntityManagerFactory
,HibernateEntityManagerFactory
,Mapping
,QueryParameterBindingTypeResolver
,Referenceable
,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
-
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 javax.naming.Referenceable
getReference
-
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
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
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 for 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
-
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(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(String rootEntityName)
Get the identifier generator for the hierarchy
-
getEntityNotFoundDelegate
EntityNotFoundDelegate getEntityNotFoundDelegate()
-
getSqlFunctionRegistry
SQLFunctionRegistry getSqlFunctionRegistry()
-
addObserver
void addObserver(SessionFactoryObserver observer)
-
getCustomEntityDirtinessStrategy
CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy()
- Todo:
- make a Service ?
-
getCurrentTenantIdentifierResolver
CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver()
- Todo:
- make a Service ?
-
iterateEntityNameResolvers
@Deprecated default 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(String queryString)
Deprecated.No replacement.Get the return types of a query
-
getReturnAliases
@Deprecated default String[] getReturnAliases(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(String queryName)
Deprecated.(since 5.2) UseNamedQueryRepository.getNamedQueryDefinition(java.lang.String)
instead.
-
registerNamedQueryDefinition
@Deprecated default void registerNamedQueryDefinition(String name, NamedQueryDefinition definition)
Deprecated.
-
getNamedSQLQuery
@Deprecated default NamedSQLQueryDefinition getNamedSQLQuery(String queryName)
Deprecated.(since 5.2) UseNamedQueryRepository.getNamedSQLQueryDefinition(java.lang.String)
instead.
-
registerNamedSQLQueryDefinition
@Deprecated default void registerNamedSQLQueryDefinition(String name, NamedSQLQueryDefinition definition)
Deprecated.
-
getResultSetMapping
@Deprecated default ResultSetMappingDefinition getResultSetMapping(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:
getMetamodel
in interfaceEntityManagerFactory
- Specified by:
getMetamodel
in interfaceHibernateEntityManagerFactory
-
findEntityGraphsByType
default <T> List<EntityGraph<? super T>> findEntityGraphsByType(Class<T> entityClass)
Description copied from interface:HibernateEntityManagerFactory
Find allEntityGraph
s associated with a given entity type.- Specified by:
findEntityGraphsByType
in interfaceHibernateEntityManagerFactory
- Parameters:
entityClass
- the entity type for which to find allEntityGraph
s.- Returns:
- A list of
EntityGraph
instances associated with the given entity type. The empty list is returned in case there are not entity graphs.
-
findEntityGraphsByJavaType
<T> List<RootGraphImplementor<? super T>> findEntityGraphsByJavaType(Class<T> entityClass)
-
findEntityGraphByName
RootGraphImplementor<?> findEntityGraphByName(String name)
-
getEntityPersister
@Deprecated default EntityPersister getEntityPersister(String entityName) throws MappingException
Deprecated.(since 5.2) UseMetamodelImplementor.entityPersister(Class)
instead.- Throws:
MappingException
-
getEntityPersisters
@Deprecated default Map<String,EntityPersister> getEntityPersisters()
Deprecated.(since 5.2) UseMetamodelImplementor.entityPersisters()
instead.
-
getCollectionPersister
@Deprecated default CollectionPersister getCollectionPersister(String role) throws MappingException
Deprecated.(since 5.2) UseMetamodelImplementor.collectionPersister(String)
instead.- Throws:
MappingException
-
getCollectionPersisters
@Deprecated default Map<String,CollectionPersister> getCollectionPersisters()
Deprecated.(since 5.2) UseMetamodelImplementor.collectionPersisters()
instead.
-
getCollectionRolesByEntityParticipant
@Deprecated default Set<String> getCollectionRolesByEntityParticipant(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(Class byClass)
Deprecated.(since 5.2) UseMetamodelImplementor.locateEntityPersister(Class)
instead.
-
locateEntityPersister
@Deprecated default EntityPersister locateEntityPersister(String byName)
Deprecated.(since 5.2) UseMetamodelImplementor.locateEntityPersister(String)
instead.
-
getImplementors
@Deprecated default String[] getImplementors(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 String getImportedClassName(String name)
Deprecated.UseMetamodel.getImportedClassName(java.lang.String)
insteadGet a class name, using query language imports
-
-