|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.jmx.SessionFactoryStub
A flyweight for SessionFactory. If the MBean itself does not have classpath to the persistent classes, then a stub will be registered with JNDI and the actual SessionFactoryImpl built upon first access.
Method Summary | |
void |
close()
Destroy this SessionFactory and release all resources (caches, connection pools, etc). |
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 |
getAllClassMetadata()
Get all ClassMetadata as a Map from entityname String to metadata object |
Map |
getAllCollectionMetadata()
Get all CollectionMetadata as a Map from role name to metadata object |
ClassMetadata |
getClassMetadata(Class persistentClass)
Get the ClassMetadata associated with the given entity class |
ClassMetadata |
getClassMetadata(String entityName)
Get the ClassMetadata associated with the given entity name |
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()
Get the statistics for this session factory |
boolean |
isClosed()
Was this SessionFactory already closed? |
Session |
openSession()
Create database connection and open a Session on it. |
Session |
openSession(Connection conn)
Open a Session on the given connection. |
Session |
openSession(Connection connection,
Interceptor interceptor)
Open a Session on the given connection, specifying an interceptor. |
Session |
openSession(Interceptor interceptor)
Create database connection and open a Session on it, specifying an interceptor. |
StatelessSession |
openStatelessSession()
Get a new stateless session. |
StatelessSession |
openStatelessSession(Connection conn)
Get a new stateless session for the given JDBC connection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public Session openSession(Connection connection, Interceptor interceptor)
SessionFactory
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.
openSession
in interface SessionFactory
connection
- a connection provided by the application.interceptor
- a session-scoped interceptor
public Session openSession(Interceptor interceptor) throws HibernateException
SessionFactory
openSession
in interface SessionFactory
interceptor
- a session-scoped interceptor
HibernateException
public Session openSession() throws HibernateException
SessionFactory
openSession
in interface SessionFactory
HibernateException
public Session openSession(Connection conn)
SessionFactory
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.
openSession
in interface SessionFactory
conn
- a connection provided by the application.
public Session getCurrentSession()
SessionFactory
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.
getCurrentSession
in interface SessionFactory
public Reference getReference() throws NamingException
getReference
in interface Referenceable
NamingException
Referenceable.getReference()
public ClassMetadata getClassMetadata(Class persistentClass) throws HibernateException
SessionFactory
getClassMetadata
in interface SessionFactory
HibernateException
ClassMetadata
public ClassMetadata getClassMetadata(String entityName) throws HibernateException
SessionFactory
getClassMetadata
in interface SessionFactory
HibernateException
ClassMetadata
public CollectionMetadata getCollectionMetadata(String roleName) throws HibernateException
SessionFactory
getCollectionMetadata
in interface SessionFactory
HibernateException
CollectionMetadata
public Map getAllClassMetadata() throws HibernateException
SessionFactory
getAllClassMetadata
in interface SessionFactory
HibernateException
ClassMetadata
public Map getAllCollectionMetadata() throws HibernateException
SessionFactory
getAllCollectionMetadata
in interface SessionFactory
HibernateException
CollectionMetadata
public void close() throws HibernateException
SessionFactory
close
in interface SessionFactory
HibernateException
public boolean isClosed()
SessionFactory
isClosed
in interface SessionFactory
public void evict(Class persistentClass, Serializable id) throws HibernateException
SessionFactory
evict
in interface SessionFactory
HibernateException
public void evict(Class persistentClass) throws HibernateException
SessionFactory
evict
in interface SessionFactory
HibernateException
public void evictEntity(String entityName, Serializable id) throws HibernateException
SessionFactory
evictEntity
in interface SessionFactory
HibernateException
public void evictEntity(String entityName) throws HibernateException
SessionFactory
evictEntity
in interface SessionFactory
HibernateException
public void evictCollection(String roleName, Serializable id) throws HibernateException
SessionFactory
evictCollection
in interface SessionFactory
HibernateException
public void evictCollection(String roleName) throws HibernateException
SessionFactory
evictCollection
in interface SessionFactory
HibernateException
public void evictQueries() throws HibernateException
SessionFactory
evictQueries
in interface SessionFactory
HibernateException
public void evictQueries(String cacheRegion) throws HibernateException
SessionFactory
evictQueries
in interface SessionFactory
HibernateException
public Statistics getStatistics()
SessionFactory
getStatistics
in interface SessionFactory
public StatelessSession openStatelessSession()
SessionFactory
openStatelessSession
in interface SessionFactory
public StatelessSession openStatelessSession(Connection conn)
SessionFactory
openStatelessSession
in interface SessionFactory
public Set getDefinedFilterNames()
SessionFactory
getDefinedFilterNames
in interface SessionFactory
public FilterDefinition getFilterDefinition(String filterName) throws HibernateException
SessionFactory
getFilterDefinition
in interface SessionFactory
filterName
- The name of the filter for which to obtain the definition.
HibernateException
- If no filter defined with the given name.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |