org.hibernate.impl
Class SessionFactoryImpl

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

public final class SessionFactoryImpl
extends Object
implements SessionFactory, 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.

Author:
Gavin King
See Also:
ConnectionProvider, Session, QueryTranslator, EntityPersister, CollectionPersister, Serialized Form

Constructor Summary
SessionFactoryImpl(Configuration cfg, Mapping mapping, Settings settings, EventListeners listeners, SessionFactoryObserver observer)
           
 
Method Summary
 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.
 BatcherFactory getBatcherFactory()
           
 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.
 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
 EventListeners getEventListeners()
           
 SessionFactoryObserver getFactoryObserver()
          Return the SessionFactoryObserver attached to the SessionFactory if any
 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)
          Return 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.
 String getImportedClassName(String className)
          Get a class name, using query language imports
 Interceptor getInterceptor()
          Get the factory scoped interceptor for this factory.
 NamedQueryDefinition getNamedQuery(String queryName)
           
 NamedSQLQueryDefinition getNamedSQLQuery(String queryName)
           
 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
 Settings getSettings()
           
 SQLExceptionConverter getSQLExceptionConverter()
          Retrieves the SQLExceptionConverter in effect for this SessionFactory.
 SQLFunctionRegistry getSqlFunctionRegistry()
           
 Statistics getStatistics()
          Retrieve the statistics fopr this factory.
 StatisticsImplementor getStatisticsImplementor()
          Statistics SPI
 TransactionFactory getTransactionFactory()
           
 TransactionManager getTransactionManager()
          Get the JTA transaction manager
 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?
 Iterator iterateEntityNameResolvers(EntityMode entityMode)
           
 Session openSession()
          Open a Session.
 Session openSession(Connection connection)
          Open a Session, utilizing the specfied JDBC Connection.
 Session openSession(Connection connection, boolean flushBeforeCompletionEnabled, boolean autoCloseSessionEnabled, ConnectionReleaseMode connectionReleaseMode)
          Open a session conforming to the given parameters.
 Session openSession(Connection connection, Interceptor sessionLocalInterceptor)
          Open a Session, utilizing the specfied JDBC Connection and specified Interceptor.
 Session openSession(Interceptor sessionLocalInterceptor)
          Open a Session, utilizing the specified Interceptor.
 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, EntityMode entityMode)
           
 
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,
                          Settings settings,
                          EventListeners listeners,
                          SessionFactoryObserver observer)
                   throws HibernateException
Throws:
HibernateException
Method Detail

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:

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,
                                       EntityMode entityMode)

iterateEntityNameResolvers

public Iterator iterateEntityNameResolvers(EntityMode entityMode)

getQueryPlanCache

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

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.

openSession

public Session openSession(Connection connection,
                           Interceptor sessionLocalInterceptor)
Description copied from interface: SessionFactory
Open a Session, utilizing the specfied JDBC Connection and specified Interceptor.

Note that the second-level cache will be disabled if you supply a JDBC connection. Hibernate will not be able to track any statements you might have executed in the same transaction. Consider implementing your own ConnectionProvider instead as a highly recommended alternative.

Specified by:
openSession in interface SessionFactory
Parameters:
connection - a connection provided by the application.
sessionLocalInterceptor - a session-scoped interceptor
Returns:
The created session.

openSession

public Session openSession(Interceptor sessionLocalInterceptor)
                    throws HibernateException
Description copied from interface: SessionFactory
Open a Session, utilizing the specified Interceptor.

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

Specified by:
openSession in interface SessionFactory
Parameters:
sessionLocalInterceptor - a session-scoped interceptor
Returns:
The created session.
Throws:
HibernateException - Indicates a peroblem opening the session; pretty rare here.

openSession

public Session openSession(Connection connection)
Description copied from interface: SessionFactory
Open a Session, utilizing the specfied JDBC Connection.

Note that the second-level cache will be disabled if you supply a JDBC connection. Hibernate will not be able to track any statements you might have executed in the same transaction. Consider implementing your own ConnectionProvider instead as a highly recommended alternative.

Specified by:
openSession in interface SessionFactory
Parameters:
connection - a connection provided by the application.
Returns:
The created session.

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 peroblem 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

openSession

public Session openSession(Connection connection,
                           boolean flushBeforeCompletionEnabled,
                           boolean autoCloseSessionEnabled,
                           ConnectionReleaseMode connectionReleaseMode)
                    throws HibernateException
Description copied from interface: SessionFactoryImplementor
Open a session conforming to the given parameters. Used mainly by JTASessionContext for current session processing.

Specified by:
openSession in interface SessionFactoryImplementor
Parameters:
connection - The external jdbc connection to use, if one (i.e., optional).
flushBeforeCompletionEnabled - Should the session be auto-flushed prior to transaction completion?
autoCloseSessionEnabled - Should the session be auto-closed after transaction completion?
connectionReleaseMode - The release mode for managed jdbc connections.
Returns:
An appropriate session.
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 a JTA TransactionManagerLookup 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.

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

getDialect

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

Shorthand for SessionFactoryImplementor.getSettings().Settings.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.

getTransactionFactory

public TransactionFactory getTransactionFactory()

getTransactionManager

public TransactionManager getTransactionManager()
Description copied from interface: SessionFactoryImplementor
Get the JTA transaction manager

Specified by:
getTransactionManager in interface SessionFactoryImplementor

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.

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()
                       throws NamingException
Specified by:
getReference in interface Referenceable
Throws:
NamingException

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
Return 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.

Specified by:
getImplementors in interface SessionFactoryImplementor
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 - Indicates an issue closing the factory.

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

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.

getBatcherFactory

public BatcherFactory getBatcherFactory()

getIdentifierGenerator

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

Specified by:
getIdentifierGenerator in interface SessionFactoryImplementor

getEventListeners

public EventListeners getEventListeners()

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

getFactoryObserver

public SessionFactoryObserver getFactoryObserver()
Description copied from interface: SessionFactoryImplementor
Return the SessionFactoryObserver attached to the SessionFactory if any

Specified by:
getFactoryObserver in interface SessionFactoryImplementor
Returns:

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


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