org.hibernate.internal
Class SessionFactoryImpl

java.lang.Object
  extended by org.hibernate.internal.SessionFactoryImpl
All Implemented Interfaces:
Serializable, Referenceable, Mapping, SessionFactoryImplementor, SessionFactory

public final class SessionFactoryImpl
extends Object
implements SessionFactoryImplementor

Concrete implementation of the SessionFactory interface. Has the following responsibilities

This class must appear immutable to clients, even if it does all kinds of caching and pooling under the covers. It is crucial that the class is not only thread safe, but also highly concurrent. Synchronization must be used extremely sparingly.

See Also:
ConnectionProvider, Session, QueryTranslator, EntityPersister, CollectionPersister, Serialized Form

Nested Class Summary
static class SessionFactoryImpl.StatelessSessionBuilderImpl
           
 
Nested classes/interfaces inherited from interface org.hibernate.SessionFactory
SessionFactory.SessionFactoryOptions
 
Constructor Summary
SessionFactoryImpl(Configuration cfg, Mapping mapping, ServiceRegistry serviceRegistry, Settings settings, SessionFactoryObserver observer)
           
SessionFactoryImpl(MetadataImplementor metadata, SessionFactory.SessionFactoryOptions sessionFactoryOptions, SessionFactoryObserver observer)
           
 
Method Summary
 void addObserver(SessionFactoryObserver observer)
           
 void close()
          Closes the session factory, releasing all held resources.
 boolean containsFetchProfileDefinition(String name)
          Determine if this session factory contains a fetch profile definition registered under the given name.
 void evict(Class persistentClass)
          Evict all entries from the second-level cache.
 void evict(Class persistentClass, Serializable id)
          Evict an entry from the second-level cache.
 void evictCollection(String roleName)
          Evict all entries from the second-level cache.
 void evictCollection(String roleName, Serializable id)
          Evict an entry from the second-level cache.
 void evictEntity(String entityName)
          Evict all entries from the second-level cache.
 void evictEntity(String entityName, Serializable id)
          Evict an entry from the second-level cache.
 void evictQueries()
          Evict any query result sets cached in the default query cache region.
 void evictQueries(String regionName)
          Evict any query result sets cached in the named query cache region.
 Map<String,ClassMetadata> getAllClassMetadata()
          Retrieve the ClassMetadata for all mapped entities.
 Map getAllCollectionMetadata()
          Get the CollectionMetadata for all mapped collections
 Map getAllSecondLevelCacheRegions()
          Get a map of all the second level cache regions currently maintained in this session factory.
 Cache getCache()
          Obtain direct access to the underlying cache regions.
 ClassMetadata getClassMetadata(Class persistentClass)
          Retrieve the ClassMetadata associated with the given entity class.
 ClassMetadata getClassMetadata(String entityName)
          Retrieve the ClassMetadata associated with the given entity class.
 CollectionMetadata getCollectionMetadata(String roleName)
          Get the CollectionMetadata associated with the named collection role.
 CollectionPersister getCollectionPersister(String role)
          Get the persister object for a collection role.
 Set<String> getCollectionRolesByEntityParticipant(String entityName)
          Retrieves a set of all the collection roles in which the given entity is a participant, as either an index or an element.
 ConnectionProvider getConnectionProvider()
          Get the connection provider
 Session getCurrentSession()
          Obtains the current session.
 CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver()
           
 CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy()
           
 Set getDefinedFilterNames()
          Obtain a set of the names of all filters defined on this SessionFactory.
 Dialect getDialect()
          Get the SQL dialect.
 EntityNotFoundDelegate getEntityNotFoundDelegate()
           
 EntityPersister getEntityPersister(String entityName)
          Get the persister for the named entity
 FetchProfile getFetchProfile(String name)
          Retrieve fetch profile by name.
 FilterDefinition getFilterDefinition(String filterName)
          Obtain the definition of a filter by name.
 IdentifierGenerator getIdentifierGenerator(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.
 String getIdentifierPropertyName(String className)
           
 Type getIdentifierType(String className)
           
 String[] getImplementors(String className)
          Given the name of an entity class, determine all the class and interface names by which it can be referenced in an HQL query.
 String getImportedClassName(String className)
          Get a class name, using query language imports
 Interceptor getInterceptor()
          Get the factory scoped interceptor for this factory.
 JdbcServices getJdbcServices()
          Get the JdbcServices.
 NamedQueryDefinition getNamedQuery(String queryName)
           
 NamedSQLQueryDefinition getNamedSQLQuery(String queryName)
           
 Region getNaturalIdCacheRegion(String regionName)
          Get a named naturalId cache region
 Properties getProperties()
          Get a copy of the Properties used to configure this session factory.
 QueryCache getQueryCache()
          Get the default query cache
 QueryCache getQueryCache(String regionName)
          Get a particular named query cache, or the default cache
 QueryPlanCache getQueryPlanCache()
           
 Reference getReference()
           
 Type getReferencedPropertyType(String className, String propertyName)
           
 ResultSetMappingDefinition getResultSetMapping(String resultSetName)
           
 String[] getReturnAliases(String queryString)
          Get the return aliases of a query
 Type[] getReturnTypes(String queryString)
          Get the return types of a query
 Region getSecondLevelCacheRegion(String regionName)
          Get a named second-level cache region
 ServiceRegistryImplementor getServiceRegistry()
           
 SessionFactory.SessionFactoryOptions getSessionFactoryOptions()
           
 Settings getSettings()
           
 SQLExceptionConverter getSQLExceptionConverter()
          Retrieves the SQLExceptionConverter in effect for this SessionFactory.
 SqlExceptionHelper getSQLExceptionHelper()
          Retrieves the SqlExceptionHelper in effect for this SessionFactory.
 SQLFunctionRegistry getSqlFunctionRegistry()
           
 Statistics getStatistics()
          Retrieve the statistics fopr this factory.
 StatisticsImplementor getStatisticsImplementor()
          Statistics SPI
 TransactionEnvironment getTransactionEnvironment()
           
 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
 boolean isClosed()
          Is this factory already closed?
 Iterable<EntityNameResolver> iterateEntityNameResolvers()
           
 Session openSession()
          Open a Session.
 StatelessSession openStatelessSession()
          Open a new stateless session.
 StatelessSession openStatelessSession(Connection connection)
          Open a new stateless session, utilizing the specified JDBC Connection.
 Session openTemporarySession()
          Get a nontransactional "current" session for Hibernate EntityManager
 void registerEntityNameResolver(EntityNameResolver resolver)
           
 SessionBuilderImplementor withOptions()
          Obtain a Session builder.
 StatelessSessionBuilder withStatelessOptions()
          Obtain a StatelessSession builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionFactoryImpl

public SessionFactoryImpl(Configuration cfg,
                          Mapping mapping,
                          ServiceRegistry serviceRegistry,
                          Settings settings,
                          SessionFactoryObserver observer)
                   throws HibernateException
Throws:
HibernateException

SessionFactoryImpl

public SessionFactoryImpl(MetadataImplementor metadata,
                          SessionFactory.SessionFactoryOptions sessionFactoryOptions,
                          SessionFactoryObserver observer)
                   throws HibernateException
Throws:
HibernateException
Method Detail

openSession

public Session openSession()
                    throws HibernateException
Description copied from interface: SessionFactory
Open a Session.

JDBC connection(s will be obtained from the configured ConnectionProvider as needed to perform requested work.

Specified by:
openSession in interface SessionFactory
Returns:
The created session.
Throws:
HibernateException - Indicates a problem opening the session; pretty rare here.

openTemporarySession

public Session openTemporarySession()
                             throws HibernateException
Description copied from interface: SessionFactoryImplementor
Get a nontransactional "current" session for Hibernate EntityManager

Specified by:
openTemporarySession in interface SessionFactoryImplementor
Throws:
HibernateException

getCurrentSession

public Session getCurrentSession()
                          throws HibernateException
Description copied from interface: SessionFactory
Obtains the current session. The definition of what exactly "current" means controlled by the CurrentSessionContext 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.

Specified by:
getCurrentSession in interface SessionFactory
Returns:
The current session.
Throws:
HibernateException - Indicates an issue locating a suitable current session.

withOptions

public SessionBuilderImplementor withOptions()
Description copied from interface: SessionFactory
Obtain a Session builder.

Specified by:
withOptions in interface SessionFactoryImplementor
Specified by:
withOptions in interface SessionFactory
Returns:
The session builder

withStatelessOptions

public StatelessSessionBuilder withStatelessOptions()
Description copied from interface: SessionFactory
Obtain a StatelessSession builder.

Specified by:
withStatelessOptions in interface SessionFactory
Returns:
The stateless session builder

openStatelessSession

public StatelessSession openStatelessSession()
Description copied from interface: SessionFactory
Open a new stateless session.

Specified by:
openStatelessSession in interface SessionFactory
Returns:
The created stateless session.

openStatelessSession

public StatelessSession openStatelessSession(Connection connection)
Description copied from interface: SessionFactory
Open a new stateless session, utilizing the specified JDBC Connection.

Specified by:
openStatelessSession in interface SessionFactory
Parameters:
connection - Connection provided by the application.
Returns:
The created stateless session.

addObserver

public void addObserver(SessionFactoryObserver observer)
Specified by:
addObserver in interface SessionFactoryImplementor

getTransactionEnvironment

public TransactionEnvironment getTransactionEnvironment()

getProperties

public Properties getProperties()
Description copied from interface: SessionFactoryImplementor
Get a copy of the Properties used to configure this session factory.

Specified by:
getProperties in interface SessionFactoryImplementor
Returns:
The properties.

getIdentifierGeneratorFactory

public IdentifierGeneratorFactory getIdentifierGeneratorFactory()
Description copied from interface: Mapping
Allow access to the id generator factory, though this is only needed/allowed from configuration.

Specified by:
getIdentifierGeneratorFactory in interface Mapping
Returns:
Access to the identifier generator factory

getTypeResolver

public TypeResolver getTypeResolver()
Description copied from interface: SessionFactoryImplementor
Retrieve the Type resolver associated with this factory.

Specified by:
getTypeResolver in interface SessionFactoryImplementor
Returns:
The type resolver

registerEntityNameResolver

public void registerEntityNameResolver(EntityNameResolver resolver)

iterateEntityNameResolvers

public Iterable<EntityNameResolver> iterateEntityNameResolvers()

getQueryPlanCache

public QueryPlanCache getQueryPlanCache()
Specified by:
getQueryPlanCache in interface SessionFactoryImplementor

getEntityPersister

public EntityPersister getEntityPersister(String entityName)
                                   throws MappingException
Description copied from interface: SessionFactoryImplementor
Get the persister for the named entity

Specified by:
getEntityPersister in interface SessionFactoryImplementor
Parameters:
entityName - The name of the entity for which to retrieve the persister.
Returns:
The persister
Throws:
MappingException - Indicates persister could not be found with that name.

getCollectionPersister

public CollectionPersister getCollectionPersister(String role)
                                           throws MappingException
Description copied from interface: SessionFactoryImplementor
Get the persister object for a collection role.

Specified by:
getCollectionPersister in interface SessionFactoryImplementor
Parameters:
role - The role (name) of the collection for which to retrieve the persister.
Returns:
The persister
Throws:
MappingException - Indicates persister could not be found with that role.

getSettings

public Settings getSettings()
Specified by:
getSettings in interface SessionFactoryImplementor

getSessionFactoryOptions

public SessionFactory.SessionFactoryOptions getSessionFactoryOptions()
Specified by:
getSessionFactoryOptions in interface SessionFactory

getJdbcServices

public JdbcServices getJdbcServices()
Description copied from interface: SessionFactoryImplementor
Get the JdbcServices.

Specified by:
getJdbcServices in interface SessionFactoryImplementor
Returns:
the JdbcServices

getDialect

public Dialect getDialect()
Description copied from interface: SessionFactoryImplementor
Get the SQL dialect.

Shorthand for getJdbcServices().getDialect()

Specified by:
getDialect in interface SessionFactoryImplementor
Returns:
The dialect

getInterceptor

public Interceptor getInterceptor()
Description copied from interface: SessionFactoryImplementor
Get the factory scoped interceptor for this factory.

Specified by:
getInterceptor in interface SessionFactoryImplementor
Returns:
The factory scope interceptor, or null if none.

getSQLExceptionConverter

public SQLExceptionConverter getSQLExceptionConverter()
Description copied from interface: SessionFactoryImplementor
Retrieves the SQLExceptionConverter in effect for this SessionFactory.

Specified by:
getSQLExceptionConverter in interface SessionFactoryImplementor
Returns:
The SQLExceptionConverter for this SessionFactory.

getSQLExceptionHelper

public SqlExceptionHelper getSQLExceptionHelper()
Description copied from interface: SessionFactoryImplementor
Retrieves the SqlExceptionHelper in effect for this SessionFactory.

Specified by:
getSQLExceptionHelper in interface SessionFactoryImplementor
Returns:
The SqlExceptionHelper for this SessionFactory.

getCollectionRolesByEntityParticipant

public Set<String> getCollectionRolesByEntityParticipant(String entityName)
Description copied from interface: SessionFactoryImplementor
Retrieves a set of all the collection roles in which the given entity is a participant, as either an index or an element.

Specified by:
getCollectionRolesByEntityParticipant in interface SessionFactoryImplementor
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.

getReference

public Reference getReference()
Specified by:
getReference in interface Referenceable

getNamedQuery

public NamedQueryDefinition getNamedQuery(String queryName)
Specified by:
getNamedQuery in interface SessionFactoryImplementor

getNamedSQLQuery

public NamedSQLQueryDefinition getNamedSQLQuery(String queryName)
Specified by:
getNamedSQLQuery in interface SessionFactoryImplementor

getResultSetMapping

public ResultSetMappingDefinition getResultSetMapping(String resultSetName)
Specified by:
getResultSetMapping in interface SessionFactoryImplementor

getIdentifierType

public Type getIdentifierType(String className)
                       throws MappingException
Specified by:
getIdentifierType in interface Mapping
Throws:
MappingException

getIdentifierPropertyName

public String getIdentifierPropertyName(String className)
                                 throws MappingException
Specified by:
getIdentifierPropertyName in interface Mapping
Throws:
MappingException

getReturnTypes

public Type[] getReturnTypes(String queryString)
                      throws HibernateException
Description copied from interface: SessionFactoryImplementor
Get the return types of a query

Specified by:
getReturnTypes in interface SessionFactoryImplementor
Throws:
HibernateException

getReturnAliases

public String[] getReturnAliases(String queryString)
                          throws HibernateException
Description copied from interface: SessionFactoryImplementor
Get the return aliases of a query

Specified by:
getReturnAliases in interface SessionFactoryImplementor
Throws:
HibernateException

getClassMetadata

public ClassMetadata getClassMetadata(Class persistentClass)
                               throws HibernateException
Description copied from interface: SessionFactory
Retrieve the ClassMetadata associated with the given entity class.

Specified by:
getClassMetadata in interface SessionFactory
Parameters:
persistentClass - The entity class
Returns:
The metadata associated with the given entity; may be null if no such entity was mapped.
Throws:
HibernateException - Generally null is returned instead of throwing.

getCollectionMetadata

public CollectionMetadata getCollectionMetadata(String roleName)
                                         throws HibernateException
Description copied from interface: SessionFactory
Get the CollectionMetadata associated with the named collection role.

Specified by:
getCollectionMetadata in interface SessionFactory
Parameters:
roleName - The collection role (in form [owning-entity-name].[collection-property-name]).
Returns:
The metadata associated with the given collection; may be null if no such collection was mapped.
Throws:
HibernateException - Generally null is returned instead of throwing.

getClassMetadata

public ClassMetadata getClassMetadata(String entityName)
                               throws HibernateException
Description copied from interface: SessionFactory
Retrieve the ClassMetadata associated with the given entity class.

Specified by:
getClassMetadata in interface SessionFactory
Parameters:
entityName - The entity class
Returns:
The metadata associated with the given entity; may be null if no such entity was mapped.
Throws:
HibernateException - Generally null is returned instead of throwing.

getImplementors

public String[] getImplementors(String className)
                         throws MappingException
Given the name of an entity class, determine all the class and interface names by which it can be referenced in an HQL query.

Specified by:
getImplementors in interface SessionFactoryImplementor
Parameters:
className - The name of the entity class
Returns:
the names of all persistent (mapped) classes that extend or implement the given class or interface, accounting for implicit/explicit polymorphism settings and excluding mapped subclasses/joined-subclasses of other classes in the result.
Throws:
MappingException

getImportedClassName

public String getImportedClassName(String className)
Description copied from interface: SessionFactoryImplementor
Get a class name, using query language imports

Specified by:
getImportedClassName in interface SessionFactoryImplementor

getAllClassMetadata

public Map<String,ClassMetadata> getAllClassMetadata()
                                              throws HibernateException
Description copied from interface: SessionFactory
Retrieve the ClassMetadata for all mapped entities.

Specified by:
getAllClassMetadata in interface SessionFactory
Returns:
A map containing all ClassMetadata keyed by the corresponding String entity-name.
Throws:
HibernateException - Generally empty map is returned instead of throwing.

getAllCollectionMetadata

public Map getAllCollectionMetadata()
                             throws HibernateException
Description copied from interface: SessionFactory
Get the CollectionMetadata for all mapped collections

Specified by:
getAllCollectionMetadata in interface SessionFactory
Returns:
a map from String to CollectionMetadata
Throws:
HibernateException - Generally empty map is returned instead of throwing.

getReferencedPropertyType

public Type getReferencedPropertyType(String className,
                                      String propertyName)
                               throws MappingException
Specified by:
getReferencedPropertyType in interface Mapping
Throws:
MappingException

getConnectionProvider

public ConnectionProvider getConnectionProvider()
Description copied from interface: SessionFactoryImplementor
Get the connection provider

Specified by:
getConnectionProvider in interface SessionFactoryImplementor

close

public void close()
           throws HibernateException
Closes the session factory, releasing all held resources.
  1. cleans up used cache regions and "stops" the cache provider.
  2. close the JDBC connection
  3. remove the JNDI binding
Note: Be aware that the sessionFactory instance still can be a "heavy" object memory wise after close() has been called. Thus it is important to not keep referencing the instance to let the garbage collector release the memory.

Specified by:
close in interface SessionFactory
Throws:
HibernateException

getCache

public Cache getCache()
Description copied from interface: SessionFactory
Obtain direct access to the underlying cache regions.

Specified by:
getCache in interface SessionFactory
Returns:
The direct cache access API.

evictEntity

public void evictEntity(String entityName,
                        Serializable id)
                 throws HibernateException
Description copied from interface: SessionFactory
Evict an entry from the second-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.

Specified by:
evictEntity in interface SessionFactory
Parameters:
entityName - The entity name for which to evict data.
id - The entity id
Throws:
HibernateException - Generally will mean that either that 'persisttentClass' did not name a mapped entity or a problem communicating with underlying cache impl.

evictEntity

public void evictEntity(String entityName)
                 throws HibernateException
Description copied from interface: SessionFactory
Evict all entries from the second-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.

Specified by:
evictEntity in interface SessionFactory
Parameters:
entityName - The entity name for which to evict data.
Throws:
HibernateException - Generally will mean that either that 'persisttentClass' did not name a mapped entity or a problem communicating with underlying cache impl.

evict

public void evict(Class persistentClass,
                  Serializable id)
           throws HibernateException
Description copied from interface: SessionFactory
Evict an entry from the second-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.

Specified by:
evict in interface SessionFactory
Parameters:
persistentClass - The entity class for which to evict data.
id - The entity id
Throws:
HibernateException - Generally will mean that either that 'persisttentClass' did not name a mapped entity or a problem communicating with underlying cache impl.

evict

public void evict(Class persistentClass)
           throws HibernateException
Description copied from interface: SessionFactory
Evict all entries from the second-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.

Specified by:
evict in interface SessionFactory
Parameters:
persistentClass - The entity class for which to evict data.
Throws:
HibernateException - Generally will mean that either that 'persisttentClass' did not name a mapped entity or a problem communicating with underlying cache impl.

evictCollection

public void evictCollection(String roleName,
                            Serializable id)
                     throws HibernateException
Description copied from interface: SessionFactory
Evict an entry from the second-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.

Specified by:
evictCollection in interface SessionFactory
Parameters:
roleName - The name of the collection role
id - The id of the collection owner
Throws:
HibernateException - Generally will mean that either that 'roleName' did not name a mapped collection or a problem communicating with underlying cache impl.

evictCollection

public void evictCollection(String roleName)
                     throws HibernateException
Description copied from interface: SessionFactory
Evict all entries from the second-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.

Specified by:
evictCollection in interface SessionFactory
Parameters:
roleName - The name of the collection role whose regions should be evicted
Throws:
HibernateException - Generally will mean that either that 'roleName' did not name a mapped collection or a problem communicating with underlying cache impl.

evictQueries

public void evictQueries()
                  throws HibernateException
Description copied from interface: SessionFactory
Evict any query result sets cached in the default query cache region.

Specified by:
evictQueries in interface SessionFactory
Throws:
HibernateException - Indicate a problem communicating with underlying cache impl.

evictQueries

public void evictQueries(String regionName)
                  throws HibernateException
Description copied from interface: SessionFactory
Evict any query result sets cached in the named query cache region.

Specified by:
evictQueries in interface SessionFactory
Parameters:
regionName - The named query cache region from which to evict.
Throws:
HibernateException - Since a not-found 'cacheRegion' simply no-ops, this should indicate a problem communicating with underlying cache impl.

getUpdateTimestampsCache

public UpdateTimestampsCache getUpdateTimestampsCache()
Description copied from interface: SessionFactoryImplementor
Get the cache of table update timestamps

Specified by:
getUpdateTimestampsCache in interface SessionFactoryImplementor

getQueryCache

public QueryCache getQueryCache()
Description copied from interface: SessionFactoryImplementor
Get the default query cache

Specified by:
getQueryCache in interface SessionFactoryImplementor

getQueryCache

public QueryCache getQueryCache(String regionName)
                         throws HibernateException
Description copied from interface: SessionFactoryImplementor
Get a particular named query cache, or the default cache

Specified by:
getQueryCache in interface SessionFactoryImplementor
Parameters:
regionName - the name of the cache region, or null for the default query cache
Returns:
the existing cache, or a newly created cache if none by that region name
Throws:
HibernateException

getSecondLevelCacheRegion

public Region getSecondLevelCacheRegion(String regionName)
Description copied from interface: SessionFactoryImplementor
Get a named second-level cache region

Specified by:
getSecondLevelCacheRegion in interface SessionFactoryImplementor
Parameters:
regionName - The name of the region to retrieve.
Returns:
The region

getNaturalIdCacheRegion

public Region getNaturalIdCacheRegion(String regionName)
Description copied from interface: SessionFactoryImplementor
Get a named naturalId cache region

Specified by:
getNaturalIdCacheRegion in interface SessionFactoryImplementor
Parameters:
regionName - The name of the region to retrieve.
Returns:
The region

getAllSecondLevelCacheRegions

public Map getAllSecondLevelCacheRegions()
Description copied from interface: SessionFactoryImplementor
Get a map of all the second level cache regions currently maintained in this session factory. The map is structured with the region name as the key and the Region instances as the values.

Specified by:
getAllSecondLevelCacheRegions in interface SessionFactoryImplementor
Returns:
The map of regions

isClosed

public boolean isClosed()
Description copied from interface: SessionFactory
Is this factory already closed?

Specified by:
isClosed in interface SessionFactory
Returns:
True if this factory is already closed; false otherwise.

getStatistics

public Statistics getStatistics()
Description copied from interface: SessionFactory
Retrieve the statistics fopr this factory.

Specified by:
getStatistics in interface SessionFactory
Returns:
The statistics.

getStatisticsImplementor

public StatisticsImplementor getStatisticsImplementor()
Description copied from interface: SessionFactoryImplementor
Statistics SPI

Specified by:
getStatisticsImplementor in interface SessionFactoryImplementor

getFilterDefinition

public FilterDefinition getFilterDefinition(String filterName)
                                     throws HibernateException
Description copied from interface: SessionFactory
Obtain the definition of a filter by name.

Specified by:
getFilterDefinition in interface SessionFactory
Parameters:
filterName - The name of the filter for which to obtain the definition.
Returns:
The filter definition.
Throws:
HibernateException - If no filter defined with the given name.

containsFetchProfileDefinition

public boolean containsFetchProfileDefinition(String name)
Description copied from interface: SessionFactory
Determine if this session factory contains a fetch profile definition registered under the given name.

Specified by:
containsFetchProfileDefinition in interface SessionFactory
Parameters:
name - The name to check
Returns:
True if there is such a fetch profile; false otherwise.

getDefinedFilterNames

public Set getDefinedFilterNames()
Description copied from interface: SessionFactory
Obtain a set of the names of all filters defined on this SessionFactory.

Specified by:
getDefinedFilterNames in interface SessionFactory
Returns:
The set of filter names.

getIdentifierGenerator

public IdentifierGenerator getIdentifierGenerator(String rootEntityName)
Description copied from interface: SessionFactoryImplementor
Get the identifier generator for the hierarchy

Specified by:
getIdentifierGenerator in interface SessionFactoryImplementor

getServiceRegistry

public ServiceRegistryImplementor getServiceRegistry()
Specified by:
getServiceRegistry in interface SessionFactoryImplementor

getEntityNotFoundDelegate

public EntityNotFoundDelegate getEntityNotFoundDelegate()
Specified by:
getEntityNotFoundDelegate in interface SessionFactoryImplementor

getSqlFunctionRegistry

public SQLFunctionRegistry getSqlFunctionRegistry()
Specified by:
getSqlFunctionRegistry in interface SessionFactoryImplementor

getFetchProfile

public FetchProfile getFetchProfile(String name)
Description copied from interface: SessionFactoryImplementor
Retrieve fetch profile by name.

Specified by:
getFetchProfile in interface SessionFactoryImplementor
Parameters:
name - The name of the profile to retrieve.
Returns:
The profile definition

getTypeHelper

public TypeHelper getTypeHelper()
Description copied from interface: SessionFactory
Retrieve this factory's TypeHelper

Specified by:
getTypeHelper in interface SessionFactory
Returns:
The factory's TypeHelper

getCustomEntityDirtinessStrategy

public CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy()
Specified by:
getCustomEntityDirtinessStrategy in interface SessionFactoryImplementor

getCurrentTenantIdentifierResolver

public CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver()
Specified by:
getCurrentTenantIdentifierResolver in interface SessionFactoryImplementor


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.