public class SessionFactoryDelegatingImpl extends java.lang.Object implements SessionFactoryImplementor, SessionFactory
SessionFactoryImplementor.DeserializationResolver<T extends SessionFactoryImplementor>| Constructor and Description |
|---|
SessionFactoryDelegatingImpl(SessionFactoryImplementor delegate) |
| Modifier and Type | Method and Description |
|---|---|
<T> void |
addNamedEntityGraph(java.lang.String graphName,
javax.persistence.EntityGraph<T> entityGraph) |
void |
addNamedQuery(java.lang.String name,
javax.persistence.Query query) |
void |
addObserver(SessionFactoryObserver observer) |
void |
close()
Destroy this SessionFactory and release all resources (caches,
connection pools, etc).
|
boolean |
containsFetchProfileDefinition(java.lang.String name)
Determine if this session factory contains a fetch profile definition
registered under the given name.
|
javax.persistence.EntityManager |
createEntityManager() |
javax.persistence.EntityManager |
createEntityManager(java.util.Map map) |
javax.persistence.EntityManager |
createEntityManager(javax.persistence.SynchronizationType synchronizationType) |
javax.persistence.EntityManager |
createEntityManager(javax.persistence.SynchronizationType synchronizationType,
java.util.Map map) |
protected SessionFactoryImplementor |
delegate() |
javax.persistence.EntityGraph |
findEntityGraphByName(java.lang.String name) |
<T> java.util.List<javax.persistence.EntityGraph<? super T>> |
findEntityGraphsByType(java.lang.Class<T> entityClass)
Find all
EntityGraphs associated with a given entity type. |
java.util.Map<java.lang.String,ClassMetadata> |
getAllClassMetadata()
Retrieve the
ClassMetadata for all mapped entities. |
java.util.Map |
getAllCollectionMetadata()
Get the
CollectionMetadata for all mapped collections. |
java.util.Map |
getAllSecondLevelCacheRegions()
Get a map of all the second level cache regions currently maintained in
this session factory.
|
CacheImplementor |
getCache()
Obtain direct access to the underlying cache regions.
|
ClassMetadata |
getClassMetadata(java.lang.Class entityClass)
Retrieve the
ClassMetadata associated with the given entity class. |
ClassMetadata |
getClassMetadata(java.lang.String entityName)
Retrieve the
ClassMetadata associated with the given entity class. |
CollectionMetadata |
getCollectionMetadata(java.lang.String roleName)
Get the
CollectionMetadata associated with the named collection role. |
CollectionPersister |
getCollectionPersister(java.lang.String role) |
java.util.Map<java.lang.String,CollectionPersister> |
getCollectionPersisters() |
java.util.Set<java.lang.String> |
getCollectionRolesByEntityParticipant(java.lang.String entityName) |
javax.persistence.criteria.CriteriaBuilder |
getCriteriaBuilder() |
Session |
getCurrentSession()
Obtains the current session.
|
CurrentTenantIdentifierResolver |
getCurrentTenantIdentifierResolver() |
CustomEntityDirtinessStrategy |
getCustomEntityDirtinessStrategy() |
java.util.Set |
getDefinedFilterNames()
Obtain a set of the names of all filters defined on this SessionFactory.
|
SessionFactoryImplementor.DeserializationResolver |
getDeserializationResolver() |
Dialect |
getDialect()
Get the SQL dialect.
|
EntityNotFoundDelegate |
getEntityNotFoundDelegate() |
EntityPersister |
getEntityPersister(java.lang.String entityName) |
java.util.Map<java.lang.String,EntityPersister> |
getEntityPersisters() |
FetchProfile |
getFetchProfile(java.lang.String name)
Retrieve fetch profile by name.
|
FilterDefinition |
getFilterDefinition(java.lang.String filterName)
Obtain the definition of a filter by name.
|
IdentifierGenerator |
getIdentifierGenerator(java.lang.String rootEntityName)
Get the identifier generator for the hierarchy
|
IdentifierGeneratorFactory |
getIdentifierGeneratorFactory()
Allow access to the id generator factory, though this is only needed/allowed from configuration.
|
java.lang.String |
getIdentifierPropertyName(java.lang.String className) |
Type |
getIdentifierType(java.lang.String className) |
java.lang.String[] |
getImplementors(java.lang.String className)
Get the names of all persistent classes that implement/extend the given interface/class
|
java.lang.String |
getImportedClassName(java.lang.String name)
Get a class name, using query language imports
|
Interceptor |
getInterceptor()
Get the factory scoped interceptor for this factory.
|
JdbcServices |
getJdbcServices()
Get the JdbcServices.
|
MetamodelImplementor |
getMetamodel() |
java.lang.String |
getName()
Access to the name (if one) assigned to the SessionFactory
|
NamedQueryDefinition |
getNamedQuery(java.lang.String queryName) |
NamedQueryRepository |
getNamedQueryRepository()
Provides access to the named query repository
|
NamedSQLQueryDefinition |
getNamedSQLQuery(java.lang.String queryName) |
Region |
getNaturalIdCacheRegion(java.lang.String regionName)
Get a named natural-id cache region
|
RegionAccessStrategy |
getNaturalIdCacheRegionAccessStrategy(java.lang.String regionName)
Find the "access strategy" for the named naturalId cache region.
|
javax.persistence.PersistenceUnitUtil |
getPersistenceUnitUtil() |
java.util.Map<java.lang.String,java.lang.Object> |
getProperties() |
QueryCache |
getQueryCache()
Get the default query cache.
|
QueryCache |
getQueryCache(java.lang.String regionName)
Get a particular named query cache, or the default cache
|
QueryPlanCache |
getQueryPlanCache()
Access to the cachres of HQL/JPQL and native query plans.
|
javax.naming.Reference |
getReference() |
Type |
getReferencedPropertyType(java.lang.String className,
java.lang.String propertyName) |
ResultSetMappingDefinition |
getResultSetMapping(java.lang.String name) |
java.lang.String[] |
getReturnAliases(java.lang.String queryString)
Get the return aliases of a query
|
Type[] |
getReturnTypes(java.lang.String queryString)
Get the return types of a query
|
Region |
getSecondLevelCacheRegion(java.lang.String regionName)
Get a named second-level cache region
|
RegionAccessStrategy |
getSecondLevelCacheRegionAccessStrategy(java.lang.String regionName)
Find the "access strategy" for the named cache region.
|
ServiceRegistryImplementor |
getServiceRegistry()
Access to the ServiceRegistry for this SessionFactory.
|
SessionFactoryOptions |
getSessionFactoryOptions()
Get the special options used to build the factory.
|
Settings |
getSettings() |
SQLExceptionConverter |
getSQLExceptionConverter()
Retrieves the SQLExceptionConverter in effect for this SessionFactory.
|
SqlExceptionHelper |
getSQLExceptionHelper()
Retrieves the SqlExceptionHelper in effect for this SessionFactory.
|
SQLFunctionRegistry |
getSqlFunctionRegistry() |
StatisticsImplementor |
getStatistics()
Retrieve the statistics fopr this factory.
|
StatisticsImplementor |
getStatisticsImplementor() |
TypeHelper |
getTypeHelper()
Retrieve this factory's
TypeHelper. |
TypeResolver |
getTypeResolver()
Retrieve the
Type resolver associated with this factory. |
UpdateTimestampsCache |
getUpdateTimestampsCache()
Get the cache of table update timestamps
|
java.lang.String |
getUuid()
Get the UUID for this SessionFactory.
|
boolean |
isClosed()
Is this factory already closed?
|
boolean |
isOpen() |
java.lang.Iterable<EntityNameResolver> |
iterateEntityNameResolvers() |
EntityPersister |
locateEntityPersister(java.lang.Class byClass) |
EntityPersister |
locateEntityPersister(java.lang.String byName) |
Session |
openSession()
Open a
Session. |
StatelessSession |
openStatelessSession()
Open a new stateless session.
|
StatelessSession |
openStatelessSession(java.sql.Connection connection)
Open a new stateless session, utilizing the specified JDBC
Connection. |
Session |
openTemporarySession()
Get a non-transactional "current" session (used by hibernate-envers)
|
void |
registerNamedQueryDefinition(java.lang.String name,
NamedQueryDefinition definition) |
void |
registerNamedSQLQueryDefinition(java.lang.String name,
NamedSQLQueryDefinition definition) |
Type |
resolveParameterBindType(java.lang.Class clazz) |
Type |
resolveParameterBindType(java.lang.Object bindValue) |
<T> T |
unwrap(java.lang.Class<T> cls) |
SessionBuilderImplementor |
withOptions()
Obtain a
Session builder. |
StatelessSessionBuilder |
withStatelessOptions()
Obtain a
StatelessSession builder. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEntityTypeByName, getSessionFactorypublic SessionFactoryDelegatingImpl(SessionFactoryImplementor delegate)
protected SessionFactoryImplementor delegate()
public SessionFactoryOptions getSessionFactoryOptions()
SessionFactorygetSessionFactoryOptions in interface SessionFactorypublic SessionBuilderImplementor withOptions()
SessionFactorySession builder.withOptions in interface SessionFactoryImplementorwithOptions in interface SessionFactorypublic Session openSession() throws HibernateException
SessionFactorySession.
JDBC connection(s will be obtained from the
configured ConnectionProvider as needed
to perform requested work.openSession in interface SessionFactoryHibernateException - Indicates a problem opening the session; pretty rare here.public Session getCurrentSession() throws HibernateException
SessionFactoryCurrentSessionContext impl configured
for use.
Note that for backwards compatibility, if a CurrentSessionContext
is not configured but JTA is configured this will default to the JTASessionContext
impl.getCurrentSession in interface SessionFactoryHibernateException - Indicates an issue locating a suitable current session.public StatelessSessionBuilder withStatelessOptions()
SessionFactoryStatelessSession builder.withStatelessOptions in interface SessionFactorypublic StatelessSession openStatelessSession()
SessionFactoryopenStatelessSession in interface SessionFactorypublic StatelessSession openStatelessSession(java.sql.Connection connection)
SessionFactoryConnection.openStatelessSession in interface SessionFactoryconnection - Connection provided by the application.public ClassMetadata getClassMetadata(java.lang.Class entityClass)
SessionFactoryClassMetadata associated with the given entity class.getClassMetadata in interface SessionFactoryentityClass - The entity classpublic ClassMetadata getClassMetadata(java.lang.String entityName)
SessionFactoryClassMetadata associated with the given entity class.getClassMetadata in interface SessionFactoryentityName - The entity classpublic CollectionMetadata getCollectionMetadata(java.lang.String roleName)
SessionFactoryCollectionMetadata associated with the named collection role.getCollectionMetadata in interface SessionFactoryroleName - The collection role (in form [owning-entity-name].[collection-property-name]).public java.util.Map<java.lang.String,ClassMetadata> getAllClassMetadata()
SessionFactoryClassMetadata for all mapped entities.getAllClassMetadata in interface SessionFactoryClassMetadata keyed by the
corresponding String entity-name.public java.util.Map getAllCollectionMetadata()
SessionFactoryCollectionMetadata for all mapped collections.getAllCollectionMetadata in interface SessionFactorypublic StatisticsImplementor getStatistics()
SessionFactorygetStatistics in interface SessionFactoryImplementorgetStatistics in interface SessionFactorypublic void close()
throws HibernateException
SessionFactorysessions before calling this method as the impact
on those sessions is indeterminate.
No-ops if already closed.close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface javax.persistence.EntityManagerFactoryclose in interface SessionFactoryHibernateException - Indicates an issue closing the factory.public boolean isClosed()
SessionFactoryisClosed in interface SessionFactorypublic CacheImplementor getCache()
SessionFactorygetCache in interface javax.persistence.EntityManagerFactorygetCache in interface SessionFactoryImplementorgetCache in interface SessionFactorypublic javax.persistence.PersistenceUnitUtil getPersistenceUnitUtil()
getPersistenceUnitUtil in interface javax.persistence.EntityManagerFactorypublic void addNamedQuery(java.lang.String name,
javax.persistence.Query query)
addNamedQuery in interface javax.persistence.EntityManagerFactorypublic <T> T unwrap(java.lang.Class<T> cls)
unwrap in interface javax.persistence.EntityManagerFactorypublic <T> void addNamedEntityGraph(java.lang.String graphName,
javax.persistence.EntityGraph<T> entityGraph)
addNamedEntityGraph in interface javax.persistence.EntityManagerFactorypublic java.util.Set getDefinedFilterNames()
SessionFactorygetDefinedFilterNames in interface SessionFactorypublic FilterDefinition getFilterDefinition(java.lang.String filterName) throws HibernateException
SessionFactorygetFilterDefinition in interface SessionFactoryfilterName - The name of the filter for which to obtain the definition.HibernateException - If no filter defined with the given name.public boolean containsFetchProfileDefinition(java.lang.String name)
SessionFactorycontainsFetchProfileDefinition in interface SessionFactoryname - The name to checkpublic TypeHelper getTypeHelper()
SessionFactoryTypeHelper.getTypeHelper in interface SessionFactoryTypeHelperpublic TypeResolver getTypeResolver()
SessionFactoryImplementorType resolver associated with this factory.getTypeResolver in interface SessionFactoryImplementorpublic java.util.Map<java.lang.String,java.lang.Object> getProperties()
getProperties in interface javax.persistence.EntityManagerFactorypublic EntityPersister getEntityPersister(java.lang.String entityName) throws MappingException
getEntityPersister in interface SessionFactoryImplementorMappingExceptionpublic java.util.Map<java.lang.String,EntityPersister> getEntityPersisters()
getEntityPersisters in interface SessionFactoryImplementorpublic CollectionPersister getCollectionPersister(java.lang.String role) throws MappingException
getCollectionPersister in interface SessionFactoryImplementorMappingExceptionpublic java.util.Map<java.lang.String,CollectionPersister> getCollectionPersisters()
getCollectionPersisters in interface SessionFactoryImplementorpublic JdbcServices getJdbcServices()
SessionFactoryImplementorgetJdbcServices in interface SessionFactoryImplementorpublic Dialect getDialect()
SessionFactoryImplementorgetJdbcServices().getDialect()getDialect in interface SessionFactoryImplementorpublic Interceptor getInterceptor()
SessionFactoryImplementorgetInterceptor in interface SessionFactoryImplementorpublic QueryPlanCache getQueryPlanCache()
SessionFactoryImplementorgetQueryPlanCache in interface SessionFactoryImplementorpublic Type[] getReturnTypes(java.lang.String queryString) throws HibernateException
SessionFactoryImplementorgetReturnTypes in interface SessionFactoryImplementorHibernateExceptionpublic java.lang.String[] getReturnAliases(java.lang.String queryString)
throws HibernateException
SessionFactoryImplementorgetReturnAliases in interface SessionFactoryImplementorHibernateExceptionpublic java.lang.String[] getImplementors(java.lang.String className)
throws MappingException
SessionFactoryImplementorgetImplementors in interface SessionFactoryImplementorMappingExceptionpublic java.lang.String getImportedClassName(java.lang.String name)
SessionFactoryImplementorgetImportedClassName in interface SessionFactoryImplementorpublic javax.persistence.EntityGraph findEntityGraphByName(java.lang.String name)
findEntityGraphByName in interface SessionFactoryImplementorpublic QueryCache getQueryCache()
SessionFactoryImplementorgetQueryCache in interface SessionFactoryImplementorpublic QueryCache getQueryCache(java.lang.String regionName) throws HibernateException
SessionFactoryImplementorgetQueryCache in interface SessionFactoryImplementorregionName - the name of the cache region, or null for the default query cacheHibernateExceptionpublic UpdateTimestampsCache getUpdateTimestampsCache()
SessionFactoryImplementorgetUpdateTimestampsCache in interface SessionFactoryImplementorpublic StatisticsImplementor getStatisticsImplementor()
getStatisticsImplementor in interface SessionFactoryImplementorpublic NamedQueryDefinition getNamedQuery(java.lang.String queryName)
getNamedQuery in interface SessionFactoryImplementorpublic void registerNamedQueryDefinition(java.lang.String name,
NamedQueryDefinition definition)
registerNamedQueryDefinition in interface SessionFactoryImplementorpublic NamedSQLQueryDefinition getNamedSQLQuery(java.lang.String queryName)
getNamedSQLQuery in interface SessionFactoryImplementorpublic void registerNamedSQLQueryDefinition(java.lang.String name,
NamedSQLQueryDefinition definition)
registerNamedSQLQueryDefinition in interface SessionFactoryImplementorpublic ResultSetMappingDefinition getResultSetMapping(java.lang.String name)
getResultSetMapping in interface SessionFactoryImplementorpublic IdentifierGenerator getIdentifierGenerator(java.lang.String rootEntityName)
SessionFactoryImplementorgetIdentifierGenerator in interface SessionFactoryImplementorpublic Region getSecondLevelCacheRegion(java.lang.String regionName)
SessionFactoryImplementorgetSecondLevelCacheRegion in interface SessionFactoryImplementorregionName - The name of the region to retrieve.public RegionAccessStrategy getSecondLevelCacheRegionAccessStrategy(java.lang.String regionName)
SessionFactoryImplementorgetSecondLevelCacheRegionAccessStrategy in interface SessionFactoryImplementorregionName - The name of the regionpublic Region getNaturalIdCacheRegion(java.lang.String regionName)
SessionFactoryImplementorgetNaturalIdCacheRegion in interface SessionFactoryImplementorregionName - The name of the region to retrieve.public RegionAccessStrategy getNaturalIdCacheRegionAccessStrategy(java.lang.String regionName)
SessionFactoryImplementorgetNaturalIdCacheRegionAccessStrategy in interface SessionFactoryImplementorregionName - The region namepublic java.util.Map getAllSecondLevelCacheRegions()
SessionFactoryImplementorRegion instances as the values.getAllSecondLevelCacheRegions in interface SessionFactoryImplementorpublic SQLExceptionConverter getSQLExceptionConverter()
SessionFactoryImplementorgetSQLExceptionConverter in interface SessionFactoryImplementorpublic SqlExceptionHelper getSQLExceptionHelper()
SessionFactoryImplementorgetSQLExceptionHelper in interface SessionFactoryImplementorpublic Settings getSettings()
getSettings in interface SessionFactoryImplementorpublic Session openTemporarySession() throws HibernateException
SessionFactoryImplementoropenTemporarySession in interface SessionFactoryImplementorHibernateExceptionpublic java.util.Set<java.lang.String> getCollectionRolesByEntityParticipant(java.lang.String entityName)
getCollectionRolesByEntityParticipant in interface SessionFactoryImplementorentityName - The entity name for which to get the collection roles.public EntityNotFoundDelegate getEntityNotFoundDelegate()
getEntityNotFoundDelegate in interface SessionFactoryImplementorpublic SQLFunctionRegistry getSqlFunctionRegistry()
getSqlFunctionRegistry in interface SessionFactoryImplementorpublic FetchProfile getFetchProfile(java.lang.String name)
SessionFactoryImplementorgetFetchProfile in interface SessionFactoryImplementorname - The name of the profile to retrieve.public ServiceRegistryImplementor getServiceRegistry()
SessionFactoryImplementorgetServiceRegistry in interface SessionFactoryImplementorpublic void addObserver(SessionFactoryObserver observer)
addObserver in interface SessionFactoryImplementorpublic CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy()
getCustomEntityDirtinessStrategy in interface SessionFactoryImplementorpublic CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver()
getCurrentTenantIdentifierResolver in interface SessionFactoryImplementorpublic NamedQueryRepository getNamedQueryRepository()
SessionFactoryImplementorgetNamedQueryRepository in interface SessionFactoryImplementorpublic java.lang.Iterable<EntityNameResolver> iterateEntityNameResolvers()
iterateEntityNameResolvers in interface SessionFactoryImplementorpublic EntityPersister locateEntityPersister(java.lang.Class byClass)
locateEntityPersister in interface SessionFactoryImplementorpublic EntityPersister locateEntityPersister(java.lang.String byName)
locateEntityPersister in interface SessionFactoryImplementorpublic SessionFactoryImplementor.DeserializationResolver getDeserializationResolver()
getDeserializationResolver in interface SessionFactoryImplementorpublic IdentifierGeneratorFactory getIdentifierGeneratorFactory()
MappinggetIdentifierGeneratorFactory in interface Mappingpublic Type getIdentifierType(java.lang.String className) throws MappingException
getIdentifierType in interface MappingMappingExceptionpublic java.lang.String getIdentifierPropertyName(java.lang.String className)
throws MappingException
getIdentifierPropertyName in interface MappingMappingExceptionpublic Type getReferencedPropertyType(java.lang.String className, java.lang.String propertyName) throws MappingException
getReferencedPropertyType in interface MappingMappingExceptionpublic java.lang.String getUuid()
SessionFactoryImplementorUUID, but kept
as a String.getUuid in interface SessionFactoryImplementorSessionFactoryRegistry.getSessionFactory(java.lang.String)public java.lang.String getName()
SessionFactoryImplementorgetName in interface SessionFactoryImplementorpublic javax.naming.Reference getReference()
throws javax.naming.NamingException
getReference in interface javax.naming.Referenceablejavax.naming.NamingExceptionpublic <T> java.util.List<javax.persistence.EntityGraph<? super T>> findEntityGraphsByType(java.lang.Class<T> entityClass)
HibernateEntityManagerFactoryEntityGraphs associated with a given entity type.findEntityGraphsByType in interface HibernateEntityManagerFactoryentityClass - the entity type for which to find all EntityGraphs.EntityGraph instances associated with the given entity type. The empty list is
returned in case there are not entity graphs.public javax.persistence.EntityManager createEntityManager()
createEntityManager in interface javax.persistence.EntityManagerFactorypublic javax.persistence.EntityManager createEntityManager(java.util.Map map)
createEntityManager in interface javax.persistence.EntityManagerFactorypublic javax.persistence.EntityManager createEntityManager(javax.persistence.SynchronizationType synchronizationType)
createEntityManager in interface javax.persistence.EntityManagerFactorypublic javax.persistence.EntityManager createEntityManager(javax.persistence.SynchronizationType synchronizationType,
java.util.Map map)
createEntityManager in interface javax.persistence.EntityManagerFactorypublic javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
getCriteriaBuilder in interface javax.persistence.EntityManagerFactorypublic MetamodelImplementor getMetamodel()
getMetamodel in interface javax.persistence.EntityManagerFactorygetMetamodel in interface SessionFactoryImplementorgetMetamodel in interface HibernateEntityManagerFactorypublic boolean isOpen()
isOpen in interface javax.persistence.EntityManagerFactorypublic Type resolveParameterBindType(java.lang.Object bindValue)
resolveParameterBindType in interface QueryParameterBindingTypeResolverpublic Type resolveParameterBindType(java.lang.Class clazz)
resolveParameterBindType in interface QueryParameterBindingTypeResolverCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.