public interface SessionFactory
extends Referenceable, Serializable
close
public void close()
throws HibernateException
Destroy this SessionFactory and release all resources (caches,
connection pools, etc). It is the responsibility of the application
to ensure that there are no open Sessions before calling
close().
evict
public void evict(Class persistentClass)
throws HibernateException
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.
evict
public void evict(Class persistentClass,
Serializable id)
throws HibernateException
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.
evictCollection
public void evictCollection(String roleName)
throws HibernateException
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.
evictCollection
public void evictCollection(String roleName,
Serializable id)
throws HibernateException
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.
evictEntity
public void evictEntity(String entityName)
throws HibernateException
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.
evictEntity
public void evictEntity(String entityName,
Serializable id)
throws HibernateException
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.
evictQueries
public void evictQueries()
throws HibernateException
Evict any query result sets cached in the default query cache region.
evictQueries
public void evictQueries(String cacheRegion)
throws HibernateException
Evict any query result sets cached in the named query cache region.
getAllClassMetadata
public Map getAllClassMetadata()
throws HibernateException
Get all ClassMetadata as a Map from entityname String
to metadata object
- a map from String an entity name to ClassMetaData
- 3.0 changed key from Class to String
getAllCollectionMetadata
public Map getAllCollectionMetadata()
throws HibernateException
Get all CollectionMetadata as a Map from role name
to metadata object
- a map from String to CollectionMetadata
getClassMetadata
public ClassMetadata getClassMetadata(Class persistentClass)
throws HibernateException
Get the ClassMetadata associated with the given entity class
getClassMetadata
public ClassMetadata getClassMetadata(String entityName)
throws HibernateException
Get the ClassMetadata associated with the given entity name
getCollectionMetadata
public CollectionMetadata getCollectionMetadata(String roleName)
throws HibernateException
Get the CollectionMetadata associated with the named collection role
getDefinedFilterNames
public Set getDefinedFilterNames()
Obtain a set of the names of all filters defined on this SessionFactory.
getFilterDefinition
public FilterDefinition getFilterDefinition(String filterName)
throws HibernateException
Obtain the definition of a filter by name.
filterName
- The name of the filter for which to obtain the definition.
getStatistics
public Statistics getStatistics()
Get the statistics for this session factory
isClosed
public boolean isClosed()
Was this SessionFactory already closed?
openSession
public Session openSession(Connection connection)
Open a
Session on the given 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.
connection
- a connection provided by the application.
openSession
public Session openSession(Connection connection,
Interceptor interceptor)
Open a
Session on the given connection, specifying an 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.
connection
- a connection provided by the application.interceptor
- a session-scoped interceptor
openSession
public Session openSession(Interceptor interceptor)
throws HibernateException
Create database connection and open a Session on it, specifying an
interceptor.
interceptor
- a session-scoped interceptor
openStatelessSession
public StatelessSession openStatelessSession()
Get a new stateless session.
openStatelessSession
public StatelessSession openStatelessSession(Connection connection)
Get a new stateless session for the given JDBC connection.