com.atlassian.confluence.core.persistence.confluence
Class SwitcheableSessionFactory

java.lang.Object
  extended by com.atlassian.confluence.core.persistence.confluence.SwitcheableSessionFactory
All Implemented Interfaces:
java.io.Serializable, javax.naming.Referenceable, net.sf.hibernate.engine.Mapping, net.sf.hibernate.engine.SessionFactoryImplementor, net.sf.hibernate.SessionFactory

public class SwitcheableSessionFactory
extends java.lang.Object
implements net.sf.hibernate.engine.SessionFactoryImplementor

A SessionFactory which uses a particular delegate based on the setting SessionFactoryTypeThreadLocal.

See Also:
Serialized Form

Constructor Summary
SwitcheableSessionFactory(java.util.Map<SessionFactoryTypeEnum,net.sf.hibernate.engine.SessionFactoryImplementor> sessionFactories)
           
 
Method Summary
 void close()
           
 void evict(java.lang.Class persistentClass)
           
 void evict(java.lang.Class persistentClass, java.io.Serializable id)
           
 void evictCollection(java.lang.String roleName)
           
 void evictCollection(java.lang.String roleName, java.io.Serializable id)
           
 void evictQueries()
           
 void evictQueries(java.lang.String cacheRegion)
           
 java.util.Map getAllClassMetadata()
           
 java.util.Map getAllCollectionMetadata()
           
 net.sf.hibernate.metadata.ClassMetadata getClassMetadata(java.lang.Class persistentClass)
           
 net.sf.hibernate.metadata.CollectionMetadata getCollectionMetadata(java.lang.String roleName)
           
 net.sf.hibernate.collection.CollectionPersister getCollectionPersister(java.lang.String role)
           
 net.sf.hibernate.connection.ConnectionProvider getConnectionProvider()
           
 net.sf.hibernate.engine.SessionFactoryImplementor getCurrentSessionFactory()
           
 java.lang.String getDefaultSchema()
           
 net.sf.hibernate.dialect.Dialect getDialect()
           
 java.lang.String getIdentifierPropertyName(java.lang.Class persistentClass)
           
 net.sf.hibernate.type.Type getIdentifierType(java.lang.Class persistentClass)
           
 java.lang.String[] getImplementors(java.lang.Class clazz)
           
 java.lang.String getImportedClassName(java.lang.String name)
           
 int getJdbcBatchSize()
           
 java.lang.Integer getJdbcFetchSize()
           
 java.lang.Integer getMaximumFetchDepth()
           
 net.sf.hibernate.persister.ClassPersister getPersister(java.lang.Class clazz)
           
 net.sf.hibernate.persister.ClassPersister getPersister(java.lang.String className)
           
 net.sf.hibernate.type.Type getPropertyType(java.lang.Class persistentClass, java.lang.String propertyName)
           
 net.sf.hibernate.cache.QueryCache getQueryCache()
           
 net.sf.hibernate.cache.QueryCache getQueryCache(java.lang.String regionName)
           
 javax.naming.Reference getReference()
           
 net.sf.hibernate.type.Type[] getReturnTypes(java.lang.String queryString)
           
 net.sf.hibernate.exception.SQLExceptionConverter getSQLExceptionConverter()
           
 javax.transaction.TransactionManager getTransactionManager()
           
 boolean isGetGeneratedKeysEnabled()
           
 boolean isJdbcBatchVersionedData()
           
 boolean isOuterJoinedFetchEnabled()
           
 boolean isQueryCacheEnabled()
           
 boolean isScrollableResultSetsEnabled()
           
 boolean isShowSqlEnabled()
           
 boolean isWrapResultSetsEnabled()
           
 net.sf.hibernate.Databinder openDatabinder()
           
 net.sf.hibernate.Session openSession()
           
 net.sf.hibernate.Session openSession(java.sql.Connection connection)
           
 net.sf.hibernate.Session openSession(java.sql.Connection connection, net.sf.hibernate.Interceptor interceptor)
           
 net.sf.hibernate.Session openSession(net.sf.hibernate.Interceptor interceptor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwitcheableSessionFactory

public SwitcheableSessionFactory(java.util.Map<SessionFactoryTypeEnum,net.sf.hibernate.engine.SessionFactoryImplementor> sessionFactories)
Method Detail

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Specified by:
getReference in interface javax.naming.Referenceable
Throws:
javax.naming.NamingException

openSession

public net.sf.hibernate.Session openSession(java.sql.Connection connection)
Specified by:
openSession in interface net.sf.hibernate.SessionFactory

openSession

public net.sf.hibernate.Session openSession(net.sf.hibernate.Interceptor interceptor)
                                     throws net.sf.hibernate.HibernateException
Specified by:
openSession in interface net.sf.hibernate.SessionFactory
Throws:
net.sf.hibernate.HibernateException

openSession

public net.sf.hibernate.Session openSession(java.sql.Connection connection,
                                            net.sf.hibernate.Interceptor interceptor)
Specified by:
openSession in interface net.sf.hibernate.SessionFactory

openSession

public net.sf.hibernate.Session openSession()
                                     throws net.sf.hibernate.HibernateException
Specified by:
openSession in interface net.sf.hibernate.SessionFactory
Throws:
net.sf.hibernate.HibernateException

openDatabinder

public net.sf.hibernate.Databinder openDatabinder()
                                           throws net.sf.hibernate.HibernateException
Specified by:
openDatabinder in interface net.sf.hibernate.SessionFactory
Throws:
net.sf.hibernate.HibernateException

getClassMetadata

public net.sf.hibernate.metadata.ClassMetadata getClassMetadata(java.lang.Class persistentClass)
                                                         throws net.sf.hibernate.HibernateException
Specified by:
getClassMetadata in interface net.sf.hibernate.SessionFactory
Throws:
net.sf.hibernate.HibernateException

getCollectionMetadata

public net.sf.hibernate.metadata.CollectionMetadata getCollectionMetadata(java.lang.String roleName)
                                                                   throws net.sf.hibernate.HibernateException
Specified by:
getCollectionMetadata in interface net.sf.hibernate.SessionFactory
Throws:
net.sf.hibernate.HibernateException

getAllClassMetadata

public java.util.Map getAllClassMetadata()
                                  throws net.sf.hibernate.HibernateException
Specified by:
getAllClassMetadata in interface net.sf.hibernate.SessionFactory
Throws:
net.sf.hibernate.HibernateException

getAllCollectionMetadata

public java.util.Map getAllCollectionMetadata()
                                       throws net.sf.hibernate.HibernateException
Specified by:
getAllCollectionMetadata in interface net.sf.hibernate.SessionFactory
Throws:
net.sf.hibernate.HibernateException

close

public void close()
           throws net.sf.hibernate.HibernateException
Specified by:
close in interface net.sf.hibernate.SessionFactory
Throws:
net.sf.hibernate.HibernateException

evict

public void evict(java.lang.Class persistentClass)
           throws net.sf.hibernate.HibernateException
Specified by:
evict in interface net.sf.hibernate.SessionFactory
Throws:
net.sf.hibernate.HibernateException

evict

public void evict(java.lang.Class persistentClass,
                  java.io.Serializable id)
           throws net.sf.hibernate.HibernateException
Specified by:
evict in interface net.sf.hibernate.SessionFactory
Throws:
net.sf.hibernate.HibernateException

evictCollection

public void evictCollection(java.lang.String roleName)
                     throws net.sf.hibernate.HibernateException
Specified by:
evictCollection in interface net.sf.hibernate.SessionFactory
Throws:
net.sf.hibernate.HibernateException

evictCollection

public void evictCollection(java.lang.String roleName,
                            java.io.Serializable id)
                     throws net.sf.hibernate.HibernateException
Specified by:
evictCollection in interface net.sf.hibernate.SessionFactory
Throws:
net.sf.hibernate.HibernateException

evictQueries

public void evictQueries()
                  throws net.sf.hibernate.HibernateException
Specified by:
evictQueries in interface net.sf.hibernate.SessionFactory
Throws:
net.sf.hibernate.HibernateException

evictQueries

public void evictQueries(java.lang.String cacheRegion)
                  throws net.sf.hibernate.HibernateException
Specified by:
evictQueries in interface net.sf.hibernate.SessionFactory
Throws:
net.sf.hibernate.HibernateException

getSQLExceptionConverter

public net.sf.hibernate.exception.SQLExceptionConverter getSQLExceptionConverter()
Specified by:
getSQLExceptionConverter in interface net.sf.hibernate.SessionFactory

getIdentifierType

public net.sf.hibernate.type.Type getIdentifierType(java.lang.Class persistentClass)
                                             throws net.sf.hibernate.MappingException
Specified by:
getIdentifierType in interface net.sf.hibernate.engine.Mapping
Throws:
net.sf.hibernate.MappingException

getIdentifierPropertyName

public java.lang.String getIdentifierPropertyName(java.lang.Class persistentClass)
                                           throws net.sf.hibernate.MappingException
Specified by:
getIdentifierPropertyName in interface net.sf.hibernate.engine.Mapping
Throws:
net.sf.hibernate.MappingException

getPropertyType

public net.sf.hibernate.type.Type getPropertyType(java.lang.Class persistentClass,
                                                  java.lang.String propertyName)
                                           throws net.sf.hibernate.MappingException
Specified by:
getPropertyType in interface net.sf.hibernate.engine.Mapping
Throws:
net.sf.hibernate.MappingException

getPersister

public net.sf.hibernate.persister.ClassPersister getPersister(java.lang.Class clazz)
                                                       throws net.sf.hibernate.MappingException
Specified by:
getPersister in interface net.sf.hibernate.engine.SessionFactoryImplementor
Throws:
net.sf.hibernate.MappingException

getPersister

public net.sf.hibernate.persister.ClassPersister getPersister(java.lang.String className)
                                                       throws net.sf.hibernate.MappingException
Specified by:
getPersister in interface net.sf.hibernate.engine.SessionFactoryImplementor
Throws:
net.sf.hibernate.MappingException

getCollectionPersister

public net.sf.hibernate.collection.CollectionPersister getCollectionPersister(java.lang.String role)
                                                                       throws net.sf.hibernate.MappingException
Specified by:
getCollectionPersister in interface net.sf.hibernate.engine.SessionFactoryImplementor
Throws:
net.sf.hibernate.MappingException

isOuterJoinedFetchEnabled

public boolean isOuterJoinedFetchEnabled()
Specified by:
isOuterJoinedFetchEnabled in interface net.sf.hibernate.engine.SessionFactoryImplementor

isScrollableResultSetsEnabled

public boolean isScrollableResultSetsEnabled()
Specified by:
isScrollableResultSetsEnabled in interface net.sf.hibernate.engine.SessionFactoryImplementor

isGetGeneratedKeysEnabled

public boolean isGetGeneratedKeysEnabled()
Specified by:
isGetGeneratedKeysEnabled in interface net.sf.hibernate.engine.SessionFactoryImplementor

getDefaultSchema

public java.lang.String getDefaultSchema()
Specified by:
getDefaultSchema in interface net.sf.hibernate.engine.SessionFactoryImplementor

getDialect

public net.sf.hibernate.dialect.Dialect getDialect()
Specified by:
getDialect in interface net.sf.hibernate.engine.SessionFactoryImplementor

getReturnTypes

public net.sf.hibernate.type.Type[] getReturnTypes(java.lang.String queryString)
                                            throws net.sf.hibernate.HibernateException
Specified by:
getReturnTypes in interface net.sf.hibernate.engine.SessionFactoryImplementor
Throws:
net.sf.hibernate.HibernateException

getConnectionProvider

public net.sf.hibernate.connection.ConnectionProvider getConnectionProvider()
Specified by:
getConnectionProvider in interface net.sf.hibernate.engine.SessionFactoryImplementor

getImplementors

public java.lang.String[] getImplementors(java.lang.Class clazz)
Specified by:
getImplementors in interface net.sf.hibernate.engine.SessionFactoryImplementor

getImportedClassName

public java.lang.String getImportedClassName(java.lang.String name)
Specified by:
getImportedClassName in interface net.sf.hibernate.engine.SessionFactoryImplementor

getJdbcBatchSize

public int getJdbcBatchSize()
Specified by:
getJdbcBatchSize in interface net.sf.hibernate.engine.SessionFactoryImplementor

getJdbcFetchSize

public java.lang.Integer getJdbcFetchSize()
Specified by:
getJdbcFetchSize in interface net.sf.hibernate.engine.SessionFactoryImplementor

getMaximumFetchDepth

public java.lang.Integer getMaximumFetchDepth()
Specified by:
getMaximumFetchDepth in interface net.sf.hibernate.engine.SessionFactoryImplementor

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Specified by:
getTransactionManager in interface net.sf.hibernate.engine.SessionFactoryImplementor

isShowSqlEnabled

public boolean isShowSqlEnabled()
Specified by:
isShowSqlEnabled in interface net.sf.hibernate.engine.SessionFactoryImplementor

getQueryCache

public net.sf.hibernate.cache.QueryCache getQueryCache()
Specified by:
getQueryCache in interface net.sf.hibernate.engine.SessionFactoryImplementor

getQueryCache

public net.sf.hibernate.cache.QueryCache getQueryCache(java.lang.String regionName)
                                                throws net.sf.hibernate.HibernateException
Specified by:
getQueryCache in interface net.sf.hibernate.engine.SessionFactoryImplementor
Throws:
net.sf.hibernate.HibernateException

isQueryCacheEnabled

public boolean isQueryCacheEnabled()
Specified by:
isQueryCacheEnabled in interface net.sf.hibernate.engine.SessionFactoryImplementor

isJdbcBatchVersionedData

public boolean isJdbcBatchVersionedData()
Specified by:
isJdbcBatchVersionedData in interface net.sf.hibernate.engine.SessionFactoryImplementor

isWrapResultSetsEnabled

public boolean isWrapResultSetsEnabled()
Specified by:
isWrapResultSetsEnabled in interface net.sf.hibernate.engine.SessionFactoryImplementor

getCurrentSessionFactory

public net.sf.hibernate.engine.SessionFactoryImplementor getCurrentSessionFactory()


Copyright © 2003-2014 Atlassian. All Rights Reserved.