Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.hibernate.impl.SessionFactoryImpl
public final class SessionFactoryImpl
extends java.lang.Object
implements SessionFactory, SessionFactoryImplementor
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
Map | |
Map | |
Map | |
BatcherFactory | |
ClassMetadata |
|
ClassMetadata |
|
CollectionMetadata |
|
CollectionPersister |
|
Set |
|
ConnectionProvider | |
Session | |
Set | |
Dialect | |
EntityNotFoundDelegate | |
EntityPersister |
|
EventListeners | |
FilterDefinition |
|
IdentifierGenerator |
|
String |
|
Type |
|
String[] |
|
String |
|
Interceptor | |
NamedQueryDefinition |
|
NamedSQLQueryDefinition |
|
QueryCache | |
QueryCache |
|
QueryPlanCache | |
Reference | |
Type |
|
ResultSetMappingDefinition |
|
String[] |
|
Type[] |
|
SQLExceptionConverter | |
Region |
|
Settings | |
SQLFunctionRegistry | |
Statistics | |
StatisticsImplementor | |
TransactionFactory | |
TransactionManager | |
UpdateTimestampsCache | |
boolean |
|
Session | |
Session |
|
Session |
|
Session |
|
Session |
|
StatelessSession | |
StatelessSession |
|
Session |
public SessionFactoryImpl(Configuration cfg, Mapping mapping, Settings settings, EventListeners listeners, SessionFactoryObserver observer) throws HibernateException
public void close() throws HibernateException
Closes the session factory, releasing all held resources.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.
- cleans up used cache regions and "stops" the cache provider.
- close the JDBC connection
- remove the JNDI binding
- Specified by:
- close in interface SessionFactory
public void evict(Class persistentClass) throws HibernateException
- Specified by:
- evict in interface SessionFactory
public void evict(Class persistentClass, Serializable id) throws HibernateException
- Specified by:
- evict in interface SessionFactory
public void evictCollection(String roleName) throws HibernateException
- Specified by:
- evictCollection in interface SessionFactory
public void evictCollection(String roleName, Serializable id) throws HibernateException
- Specified by:
- evictCollection in interface SessionFactory
public void evictEntity(String entityName) throws HibernateException
- Specified by:
- evictEntity in interface SessionFactory
public void evictEntity(String entityName, Serializable id) throws HibernateException
- Specified by:
- evictEntity in interface SessionFactory
public void evictQueries() throws HibernateException
- Specified by:
- evictQueries in interface SessionFactory
public void evictQueries(String cacheRegion) throws HibernateException
- Specified by:
- evictQueries in interface SessionFactory
public Map getAllClassMetadata() throws HibernateException
- Specified by:
- getAllClassMetadata in interface SessionFactory
public Map getAllCollectionMetadata() throws HibernateException
- Specified by:
- getAllCollectionMetadata in interface SessionFactory
public Map getAllSecondLevelCacheRegions()
- Specified by:
- getAllSecondLevelCacheRegions in interface SessionFactoryImplementor
public ClassMetadata getClassMetadata(Class persistentClass) throws HibernateException
- Specified by:
- getClassMetadata in interface SessionFactory
public ClassMetadata getClassMetadata(String entityName) throws HibernateException
- Specified by:
- getClassMetadata in interface SessionFactory
public CollectionMetadata getCollectionMetadata(String roleName) throws HibernateException
- Specified by:
- getCollectionMetadata in interface SessionFactory
public CollectionPersister getCollectionPersister(String role) throws MappingException
- Specified by:
- getCollectionPersister in interface SessionFactoryImplementor
public Set getCollectionRolesByEntityParticipant(String entityName)
- Specified by:
- getCollectionRolesByEntityParticipant in interface SessionFactoryImplementor
public ConnectionProvider getConnectionProvider()
- Specified by:
- getConnectionProvider in interface SessionFactoryImplementor
public Session getCurrentSession() throws HibernateException
- Specified by:
- getCurrentSession in interface SessionFactory
public Set getDefinedFilterNames()
- Specified by:
- getDefinedFilterNames in interface SessionFactory
public EntityNotFoundDelegate getEntityNotFoundDelegate()
- Specified by:
- getEntityNotFoundDelegate in interface SessionFactoryImplementor
public EntityPersister getEntityPersister(String entityName) throws MappingException
- Specified by:
- getEntityPersister in interface SessionFactoryImplementor
public FilterDefinition getFilterDefinition(String filterName) throws HibernateException
- Specified by:
- getFilterDefinition in interface SessionFactory
public IdentifierGenerator getIdentifierGenerator(String rootEntityName)
- Specified by:
- getIdentifierGenerator in interface SessionFactoryImplementor
public String getIdentifierPropertyName(String className) throws MappingException
- Specified by:
- getIdentifierPropertyName in interface Mapping
public Type getIdentifierType(String className) throws MappingException
- Specified by:
- getIdentifierType in interface Mapping
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
public String getImportedClassName(String className)
- Specified by:
- getImportedClassName in interface SessionFactoryImplementor
public Interceptor getInterceptor()
- Specified by:
- getInterceptor in interface SessionFactoryImplementor
public NamedQueryDefinition getNamedQuery(String queryName)
- Specified by:
- getNamedQuery in interface SessionFactoryImplementor
public NamedSQLQueryDefinition getNamedSQLQuery(String queryName)
- Specified by:
- getNamedSQLQuery in interface SessionFactoryImplementor
public QueryCache getQueryCache()
- Specified by:
- getQueryCache in interface SessionFactoryImplementor
public QueryCache getQueryCache(String regionName) throws HibernateException
- Specified by:
- getQueryCache in interface SessionFactoryImplementor
public QueryPlanCache getQueryPlanCache()
- Specified by:
- getQueryPlanCache in interface SessionFactoryImplementor
public Reference getReference() throws NamingException
public Type getReferencedPropertyType(String className, String propertyName) throws MappingException
- Specified by:
- getReferencedPropertyType in interface Mapping
public ResultSetMappingDefinition getResultSetMapping(String resultSetName)
- Specified by:
- getResultSetMapping in interface SessionFactoryImplementor
public String[] getReturnAliases(String queryString) throws HibernateException
- Specified by:
- getReturnAliases in interface SessionFactoryImplementor
public Type[] getReturnTypes(String queryString) throws HibernateException
- Specified by:
- getReturnTypes in interface SessionFactoryImplementor
public SQLExceptionConverter getSQLExceptionConverter()
- Specified by:
- getSQLExceptionConverter in interface SessionFactoryImplementor
public Region getSecondLevelCacheRegion(String regionName)
- Specified by:
- getSecondLevelCacheRegion in interface SessionFactoryImplementor
public Settings getSettings()
- Specified by:
- getSettings in interface SessionFactoryImplementor
public SQLFunctionRegistry getSqlFunctionRegistry()
- Specified by:
- getSqlFunctionRegistry in interface SessionFactoryImplementor
public Statistics getStatistics()
- Specified by:
- getStatistics in interface SessionFactory
public StatisticsImplementor getStatisticsImplementor()
- Specified by:
- getStatisticsImplementor in interface SessionFactoryImplementor
public TransactionManager getTransactionManager()
- Specified by:
- getTransactionManager in interface SessionFactoryImplementor
public UpdateTimestampsCache getUpdateTimestampsCache()
- Specified by:
- getUpdateTimestampsCache in interface SessionFactoryImplementor
public Session openSession() throws HibernateException
- Specified by:
- openSession in interface SessionFactory
public Session openSession(Connection connection)
- Specified by:
- openSession in interface SessionFactory
public Session openSession(Connection connection, boolean flushBeforeCompletionEnabled, boolean autoCloseSessionEnabled, ConnectionReleaseMode connectionReleaseMode) throws HibernateException
- Specified by:
- openSession in interface SessionFactoryImplementor
public Session openSession(Connection connection, Interceptor sessionLocalInterceptor)
- Specified by:
- openSession in interface SessionFactory
public Session openSession(Interceptor sessionLocalInterceptor) throws HibernateException
- Specified by:
- openSession in interface SessionFactory
public StatelessSession openStatelessSession()
- Specified by:
- openStatelessSession in interface SessionFactory
public StatelessSession openStatelessSession(Connection connection)
- Specified by:
- openStatelessSession in interface SessionFactory
public Session openTemporarySession() throws HibernateException
- Specified by:
- openTemporarySession in interface SessionFactoryImplementor