public class SessionFactoryStub extends Object implements SessionFactory
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Destroy this SessionFactory and release all resources (caches,
connection pools, etc).
|
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 cacheRegion)
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 |
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. |
Session |
getCurrentSession()
Obtains the current session.
|
Set |
getDefinedFilterNames()
Obtain a set of the names of all filters defined on this SessionFactory.
|
FilterDefinition |
getFilterDefinition(String filterName)
Obtain the definition of a filter by name.
|
Reference |
getReference() |
Statistics |
getStatistics()
Retrieve the statistics fopr this factory.
|
TypeHelper |
getTypeHelper()
Retrieve this factory's
TypeHelper |
boolean |
isClosed()
Is this factory already closed?
|
Session |
openSession()
Open a
Session. |
Session |
openSession(Connection conn)
Open a
Session, utilizing the specfied JDBC Connection. |
Session |
openSession(Connection connection,
Interceptor interceptor)
|
Session |
openSession(Interceptor interceptor)
Open a
Session, utilizing the specified Interceptor. |
StatelessSession |
openStatelessSession()
Open a new stateless session.
|
StatelessSession |
openStatelessSession(Connection conn)
Open a new stateless session, utilizing the specified JDBC
Connection. |
public Session openSession(Connection connection, Interceptor interceptor)
SessionFactorySession, 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.
openSession in interface SessionFactoryconnection - a connection provided by the application.interceptor - a session-scoped interceptorpublic Session openSession(Interceptor interceptor) throws HibernateException
SessionFactorySession, utilizing the specified Interceptor.
JDBC connection(s will be obtained from the
configured ConnectionProvider as needed
to perform requested work.openSession in interface SessionFactoryinterceptor - a session-scoped interceptorHibernateException - Indicates a peroblem opening the session; pretty rare here.public 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 peroblem opening the session; pretty rare here.public Session openSession(Connection conn)
SessionFactorySession, 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.
openSession in interface SessionFactoryconn - a connection provided by the application.public Session getCurrentSession()
SessionFactoryCurrentSessionContext 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.getCurrentSession in interface SessionFactorypublic Reference getReference() throws NamingException
getReference in interface ReferenceableNamingExceptionReferenceable.getReference()public ClassMetadata getClassMetadata(Class persistentClass) throws HibernateException
SessionFactoryClassMetadata associated with the given entity class.getClassMetadata in interface SessionFactorypersistentClass - The entity classHibernateException - Generally null is returned instead of throwing.public ClassMetadata getClassMetadata(String entityName) throws HibernateException
SessionFactoryClassMetadata associated with the given entity class.getClassMetadata in interface SessionFactoryentityName - The entity classHibernateException - Generally null is returned instead of throwing.public CollectionMetadata getCollectionMetadata(String roleName) throws HibernateException
SessionFactoryCollectionMetadata associated with the named collection role.getCollectionMetadata in interface SessionFactoryroleName - The collection role (in form [owning-entity-name].[collection-property-name]).HibernateException - Generally null is returned instead of throwing.public Map<String,ClassMetadata> getAllClassMetadata() throws HibernateException
SessionFactoryClassMetadata for all mapped entities.getAllClassMetadata in interface SessionFactoryClassMetadata keyed by the
corresponding String entity-name.HibernateException - Generally empty map is returned instead of throwing.public Map getAllCollectionMetadata() throws HibernateException
SessionFactoryCollectionMetadata for all mapped collectionsgetAllCollectionMetadata in interface SessionFactoryHibernateException - Generally empty map is returned instead of throwing.public 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 SessionFactoryHibernateException - Indicates an issue closing the factory.public boolean isClosed()
SessionFactoryisClosed in interface SessionFactorypublic Cache getCache()
SessionFactorygetCache in interface SessionFactorypublic void evict(Class persistentClass, Serializable id) throws HibernateException
SessionFactoryevict in interface SessionFactorypersistentClass - The entity class for which to evict data.id - The entity idHibernateException - Generally will mean that either that
'persisttentClass' did not name a mapped entity or a problem
communicating with underlying cache impl.public void evict(Class persistentClass) throws HibernateException
SessionFactoryevict in interface SessionFactorypersistentClass - The entity class for which to evict data.HibernateException - Generally will mean that either that
'persisttentClass' did not name a mapped entity or a problem
communicating with underlying cache impl.public void evictEntity(String entityName, Serializable id) throws HibernateException
SessionFactoryevictEntity in interface SessionFactoryentityName - The entity name for which to evict data.id - The entity idHibernateException - Generally will mean that either that
'persisttentClass' did not name a mapped entity or a problem
communicating with underlying cache impl.public void evictEntity(String entityName) throws HibernateException
SessionFactoryevictEntity in interface SessionFactoryentityName - The entity name for which to evict data.HibernateException - Generally will mean that either that
'persisttentClass' did not name a mapped entity or a problem
communicating with underlying cache impl.public void evictCollection(String roleName, Serializable id) throws HibernateException
SessionFactoryevictCollection in interface SessionFactoryroleName - The name of the collection roleid - The id of the collection ownerHibernateException - Generally will mean that either that
'roleName' did not name a mapped collection or a problem
communicating with underlying cache impl.public void evictCollection(String roleName) throws HibernateException
SessionFactoryevictCollection in interface SessionFactoryroleName - The name of the collection role whose regions should be evictedHibernateException - Generally will mean that either that
'roleName' did not name a mapped collection or a problem
communicating with underlying cache impl.public void evictQueries()
throws HibernateException
SessionFactoryevictQueries in interface SessionFactoryHibernateException - Indicate a problem communicating with
underlying cache impl.public void evictQueries(String cacheRegion) throws HibernateException
SessionFactoryevictQueries in interface SessionFactorycacheRegion - The named query cache region from which to evict.HibernateException - Since a not-found 'cacheRegion' simply no-ops,
this should indicate a problem communicating with underlying cache impl.public Statistics getStatistics()
SessionFactorygetStatistics in interface SessionFactorypublic StatelessSession openStatelessSession()
SessionFactoryopenStatelessSession in interface SessionFactorypublic StatelessSession openStatelessSession(Connection conn)
SessionFactoryConnection.openStatelessSession in interface SessionFactoryconn - Connection provided by the application.public Set getDefinedFilterNames()
SessionFactorygetDefinedFilterNames in interface SessionFactorypublic FilterDefinition getFilterDefinition(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(String name)
SessionFactorycontainsFetchProfileDefinition in interface SessionFactoryname - The name to checkpublic TypeHelper getTypeHelper()
SessionFactoryTypeHelpergetTypeHelper in interface SessionFactoryTypeHelperCopyright © 2002-2017 Red Hat Middleware, LLC. All Rights Reserved