Class SwitchableCachingSessionFactory
- java.lang.Object
-
- com.atlassian.confluence.impl.core.persistence.hibernate.SwitchableCachingSessionFactory
-
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
,Referenceable
,javax.persistence.EntityManagerFactory
,org.hibernate.engine.spi.Mapping
,org.hibernate.engine.spi.SessionFactoryImplementor
,org.hibernate.jpa.HibernateEntityManagerFactory
,org.hibernate.query.spi.QueryParameterBindingTypeResolver
,org.hibernate.SessionFactory
public class SwitchableCachingSessionFactory extends Object implements org.hibernate.engine.spi.SessionFactoryImplementor
Sessions created by this factory always have cacheMode set toCacheMode.IGNORE
whenSessionCacheModeThreadLocal
is set toCacheMode.IGNORE
- Since:
- 6.14
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> void
addNamedEntityGraph(String s, javax.persistence.EntityGraph<T> entityGraph)
void
addNamedQuery(String s, javax.persistence.Query query)
void
addObserver(org.hibernate.SessionFactoryObserver observer)
void
close()
boolean
containsFetchProfileDefinition(String name)
javax.persistence.EntityManager
createEntityManager()
javax.persistence.EntityManager
createEntityManager(Map map)
javax.persistence.EntityManager
createEntityManager(javax.persistence.SynchronizationType synchronizationType)
javax.persistence.EntityManager
createEntityManager(javax.persistence.SynchronizationType synchronizationType, Map map)
org.hibernate.graph.spi.RootGraphImplementor<?>
findEntityGraphByName(String name)
<T> List<org.hibernate.graph.spi.RootGraphImplementor<? super T>>
findEntityGraphsByJavaType(Class<T> aClass)
<T> List<javax.persistence.EntityGraph<? super T>>
findEntityGraphsByType(Class<T> entityClass)
Map<String,org.hibernate.metadata.ClassMetadata>
getAllClassMetadata()
Map
getAllCollectionMetadata()
org.hibernate.cache.spi.CacheImplementor
getCache()
org.hibernate.metadata.ClassMetadata
getClassMetadata(Class entityClass)
org.hibernate.metadata.ClassMetadata
getClassMetadata(String entityName)
org.hibernate.metadata.CollectionMetadata
getCollectionMetadata(String roleName)
javax.persistence.criteria.CriteriaBuilder
getCriteriaBuilder()
org.hibernate.Session
getCurrentSession()
org.hibernate.context.spi.CurrentTenantIdentifierResolver
getCurrentTenantIdentifierResolver()
org.hibernate.CustomEntityDirtinessStrategy
getCustomEntityDirtinessStrategy()
Set
getDefinedFilterNames()
org.hibernate.engine.spi.SessionFactoryImplementor.DeserializationResolver
getDeserializationResolver()
org.hibernate.proxy.EntityNotFoundDelegate
getEntityNotFoundDelegate()
org.hibernate.event.spi.EventEngine
getEventEngine()
org.hibernate.internal.FastSessionServices
getFastSessionServices()
org.hibernate.engine.profile.FetchProfile
getFetchProfile(String name)
org.hibernate.engine.spi.FilterDefinition
getFilterDefinition(String filterName)
org.hibernate.id.IdentifierGenerator
getIdentifierGenerator(String rootEntityName)
org.hibernate.id.factory.IdentifierGeneratorFactory
getIdentifierGeneratorFactory()
String
getIdentifierPropertyName(String className)
org.hibernate.type.Type
getIdentifierType(String className)
org.hibernate.Interceptor
getInterceptor()
org.hibernate.engine.jdbc.spi.JdbcServices
getJdbcServices()
org.hibernate.metamodel.spi.MetamodelImplementor
getMetamodel()
String
getName()
org.hibernate.query.spi.NamedQueryRepository
getNamedQueryRepository()
javax.persistence.PersistenceUnitUtil
getPersistenceUnitUtil()
Map<String,Object>
getProperties()
org.hibernate.engine.query.spi.QueryPlanCache
getQueryPlanCache()
Reference
getReference()
org.hibernate.type.Type
getReferencedPropertyType(String className, String propertyName)
org.hibernate.service.spi.ServiceRegistryImplementor
getServiceRegistry()
org.hibernate.boot.spi.SessionFactoryOptions
getSessionFactoryOptions()
org.hibernate.cfg.Settings
getSettings()
org.hibernate.dialect.function.SQLFunctionRegistry
getSqlFunctionRegistry()
org.hibernate.boot.model.relational.SqlStringGenerationContext
getSqlStringGenerationContext()
org.hibernate.stat.spi.StatisticsImplementor
getStatistics()
org.hibernate.TypeHelper
getTypeHelper()
org.hibernate.type.TypeResolver
getTypeResolver()
String
getUuid()
boolean
isClosed()
boolean
isOpen()
org.hibernate.Session
openSession()
org.hibernate.StatelessSession
openStatelessSession()
org.hibernate.StatelessSession
openStatelessSession(Connection connection)
org.hibernate.Session
openTemporarySession()
org.hibernate.type.Type
resolveParameterBindType(Class clazz)
org.hibernate.type.Type
resolveParameterBindType(Object bindValue)
<T> T
unwrap(Class<T> aClass)
org.hibernate.engine.spi.SessionBuilderImplementor
withOptions()
org.hibernate.StatelessSessionBuilder
withStatelessOptions()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.jpa.HibernateEntityManagerFactory
getEntityManagerFactoryName, getEntityTypeByName, getSessionFactory
-
Methods inherited from interface org.hibernate.engine.spi.SessionFactoryImplementor
getCollectionPersister, getCollectionPersisters, getCollectionRolesByEntityParticipant, getDialect, getEntityPersister, getEntityPersisters, getImplementors, getImportedClassName, getNamedQuery, getNamedSQLQuery, getResultSetMapping, getReturnAliases, getReturnTypes, getSQLExceptionConverter, getSQLExceptionHelper, getStatisticsImplementor, iterateEntityNameResolvers, locateEntityPersister, locateEntityPersister, registerNamedQueryDefinition, registerNamedSQLQueryDefinition
-
-
-
-
Method Detail
-
getSessionFactoryOptions
public org.hibernate.boot.spi.SessionFactoryOptions getSessionFactoryOptions()
- Specified by:
getSessionFactoryOptions
in interfaceorg.hibernate.SessionFactory
-
getUuid
public String getUuid()
- Specified by:
getUuid
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getName
public String getName()
- Specified by:
getName
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
withOptions
public org.hibernate.engine.spi.SessionBuilderImplementor withOptions()
- Specified by:
withOptions
in interfaceorg.hibernate.SessionFactory
- Specified by:
withOptions
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
openTemporarySession
public org.hibernate.Session openTemporarySession() throws org.hibernate.HibernateException
- Specified by:
openTemporarySession
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
- Throws:
org.hibernate.HibernateException
-
openSession
public org.hibernate.Session openSession() throws org.hibernate.HibernateException
- Specified by:
openSession
in interfaceorg.hibernate.SessionFactory
- Throws:
org.hibernate.HibernateException
-
getCurrentSession
public org.hibernate.Session getCurrentSession() throws org.hibernate.HibernateException
- Specified by:
getCurrentSession
in interfaceorg.hibernate.SessionFactory
- Throws:
org.hibernate.HibernateException
-
withStatelessOptions
public org.hibernate.StatelessSessionBuilder withStatelessOptions()
- Specified by:
withStatelessOptions
in interfaceorg.hibernate.SessionFactory
-
openStatelessSession
public org.hibernate.StatelessSession openStatelessSession()
- Specified by:
openStatelessSession
in interfaceorg.hibernate.SessionFactory
-
openStatelessSession
public org.hibernate.StatelessSession openStatelessSession(Connection connection)
- Specified by:
openStatelessSession
in interfaceorg.hibernate.SessionFactory
-
getStatistics
public org.hibernate.stat.spi.StatisticsImplementor getStatistics()
- Specified by:
getStatistics
in interfaceorg.hibernate.SessionFactory
- Specified by:
getStatistics
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getServiceRegistry
public org.hibernate.service.spi.ServiceRegistryImplementor getServiceRegistry()
- Specified by:
getServiceRegistry
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getEventEngine
public org.hibernate.event.spi.EventEngine getEventEngine()
- Specified by:
getEventEngine
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getInterceptor
public org.hibernate.Interceptor getInterceptor()
- Specified by:
getInterceptor
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getQueryPlanCache
public org.hibernate.engine.query.spi.QueryPlanCache getQueryPlanCache()
- Specified by:
getQueryPlanCache
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getNamedQueryRepository
public org.hibernate.query.spi.NamedQueryRepository getNamedQueryRepository()
- Specified by:
getNamedQueryRepository
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getFetchProfile
public org.hibernate.engine.profile.FetchProfile getFetchProfile(String name)
- Specified by:
getFetchProfile
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getTypeResolver
public org.hibernate.type.TypeResolver getTypeResolver()
- Specified by:
getTypeResolver
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getIdentifierGenerator
public org.hibernate.id.IdentifierGenerator getIdentifierGenerator(String rootEntityName)
- Specified by:
getIdentifierGenerator
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getEntityNotFoundDelegate
public org.hibernate.proxy.EntityNotFoundDelegate getEntityNotFoundDelegate()
- Specified by:
getEntityNotFoundDelegate
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getSqlFunctionRegistry
public org.hibernate.dialect.function.SQLFunctionRegistry getSqlFunctionRegistry()
- Specified by:
getSqlFunctionRegistry
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
addObserver
public void addObserver(org.hibernate.SessionFactoryObserver observer)
- Specified by:
addObserver
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getCustomEntityDirtinessStrategy
public org.hibernate.CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy()
- Specified by:
getCustomEntityDirtinessStrategy
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getCurrentTenantIdentifierResolver
public org.hibernate.context.spi.CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver()
- Specified by:
getCurrentTenantIdentifierResolver
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getFastSessionServices
public org.hibernate.internal.FastSessionServices getFastSessionServices()
- Specified by:
getFastSessionServices
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getDeserializationResolver
public org.hibernate.engine.spi.SessionFactoryImplementor.DeserializationResolver getDeserializationResolver()
- Specified by:
getDeserializationResolver
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getJdbcServices
public org.hibernate.engine.jdbc.spi.JdbcServices getJdbcServices()
- Specified by:
getJdbcServices
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getSqlStringGenerationContext
public org.hibernate.boot.model.relational.SqlStringGenerationContext getSqlStringGenerationContext()
- Specified by:
getSqlStringGenerationContext
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getSettings
public org.hibernate.cfg.Settings getSettings()
- Specified by:
getSettings
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
close
public void close() throws org.hibernate.HibernateException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfacejavax.persistence.EntityManagerFactory
- Specified by:
close
in interfaceorg.hibernate.SessionFactory
- Throws:
org.hibernate.HibernateException
-
getProperties
public Map<String,Object> getProperties()
- Specified by:
getProperties
in interfacejavax.persistence.EntityManagerFactory
-
isClosed
public boolean isClosed()
- Specified by:
isClosed
in interfaceorg.hibernate.SessionFactory
-
getCache
public org.hibernate.cache.spi.CacheImplementor getCache()
- Specified by:
getCache
in interfacejavax.persistence.EntityManagerFactory
- Specified by:
getCache
in interfaceorg.hibernate.SessionFactory
- Specified by:
getCache
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
getPersistenceUnitUtil
public javax.persistence.PersistenceUnitUtil getPersistenceUnitUtil()
- Specified by:
getPersistenceUnitUtil
in interfacejavax.persistence.EntityManagerFactory
-
addNamedQuery
public void addNamedQuery(String s, javax.persistence.Query query)
- Specified by:
addNamedQuery
in interfacejavax.persistence.EntityManagerFactory
-
unwrap
public <T> T unwrap(Class<T> aClass)
- Specified by:
unwrap
in interfacejavax.persistence.EntityManagerFactory
-
addNamedEntityGraph
public <T> void addNamedEntityGraph(String s, javax.persistence.EntityGraph<T> entityGraph)
- Specified by:
addNamedEntityGraph
in interfacejavax.persistence.EntityManagerFactory
-
getDefinedFilterNames
public Set getDefinedFilterNames()
- Specified by:
getDefinedFilterNames
in interfaceorg.hibernate.SessionFactory
-
getFilterDefinition
public org.hibernate.engine.spi.FilterDefinition getFilterDefinition(String filterName) throws org.hibernate.HibernateException
- Specified by:
getFilterDefinition
in interfaceorg.hibernate.SessionFactory
- Throws:
org.hibernate.HibernateException
-
containsFetchProfileDefinition
public boolean containsFetchProfileDefinition(String name)
- Specified by:
containsFetchProfileDefinition
in interfaceorg.hibernate.SessionFactory
-
getTypeHelper
public org.hibernate.TypeHelper getTypeHelper()
- Specified by:
getTypeHelper
in interfaceorg.hibernate.SessionFactory
-
getClassMetadata
public org.hibernate.metadata.ClassMetadata getClassMetadata(Class entityClass)
- Specified by:
getClassMetadata
in interfaceorg.hibernate.SessionFactory
-
getClassMetadata
public org.hibernate.metadata.ClassMetadata getClassMetadata(String entityName)
- Specified by:
getClassMetadata
in interfaceorg.hibernate.SessionFactory
-
getCollectionMetadata
public org.hibernate.metadata.CollectionMetadata getCollectionMetadata(String roleName)
- Specified by:
getCollectionMetadata
in interfaceorg.hibernate.SessionFactory
-
getAllClassMetadata
public Map<String,org.hibernate.metadata.ClassMetadata> getAllClassMetadata()
- Specified by:
getAllClassMetadata
in interfaceorg.hibernate.SessionFactory
-
getAllCollectionMetadata
public Map getAllCollectionMetadata()
- Specified by:
getAllCollectionMetadata
in interfaceorg.hibernate.SessionFactory
-
getReference
public Reference getReference() throws NamingException
- Specified by:
getReference
in interfaceReferenceable
- Throws:
NamingException
-
findEntityGraphsByType
public <T> List<javax.persistence.EntityGraph<? super T>> findEntityGraphsByType(Class<T> entityClass)
- Specified by:
findEntityGraphsByType
in interfaceorg.hibernate.jpa.HibernateEntityManagerFactory
- Specified by:
findEntityGraphsByType
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
findEntityGraphsByJavaType
public <T> List<org.hibernate.graph.spi.RootGraphImplementor<? super T>> findEntityGraphsByJavaType(Class<T> aClass)
- Specified by:
findEntityGraphsByJavaType
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
createEntityManager
public javax.persistence.EntityManager createEntityManager()
- Specified by:
createEntityManager
in interfacejavax.persistence.EntityManagerFactory
-
createEntityManager
public javax.persistence.EntityManager createEntityManager(Map map)
- Specified by:
createEntityManager
in interfacejavax.persistence.EntityManagerFactory
-
createEntityManager
public javax.persistence.EntityManager createEntityManager(javax.persistence.SynchronizationType synchronizationType)
- Specified by:
createEntityManager
in interfacejavax.persistence.EntityManagerFactory
-
createEntityManager
public javax.persistence.EntityManager createEntityManager(javax.persistence.SynchronizationType synchronizationType, Map map)
- Specified by:
createEntityManager
in interfacejavax.persistence.EntityManagerFactory
-
getCriteriaBuilder
public javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
- Specified by:
getCriteriaBuilder
in interfacejavax.persistence.EntityManagerFactory
-
getMetamodel
public org.hibernate.metamodel.spi.MetamodelImplementor getMetamodel()
- Specified by:
getMetamodel
in interfacejavax.persistence.EntityManagerFactory
- Specified by:
getMetamodel
in interfaceorg.hibernate.jpa.HibernateEntityManagerFactory
- Specified by:
getMetamodel
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
findEntityGraphByName
public org.hibernate.graph.spi.RootGraphImplementor<?> findEntityGraphByName(String name)
- Specified by:
findEntityGraphByName
in interfaceorg.hibernate.engine.spi.SessionFactoryImplementor
-
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interfacejavax.persistence.EntityManagerFactory
-
getIdentifierGeneratorFactory
public org.hibernate.id.factory.IdentifierGeneratorFactory getIdentifierGeneratorFactory()
- Specified by:
getIdentifierGeneratorFactory
in interfaceorg.hibernate.engine.spi.Mapping
-
getIdentifierType
public org.hibernate.type.Type getIdentifierType(String className) throws org.hibernate.MappingException
- Specified by:
getIdentifierType
in interfaceorg.hibernate.engine.spi.Mapping
- Throws:
org.hibernate.MappingException
-
getIdentifierPropertyName
public String getIdentifierPropertyName(String className) throws org.hibernate.MappingException
- Specified by:
getIdentifierPropertyName
in interfaceorg.hibernate.engine.spi.Mapping
- Throws:
org.hibernate.MappingException
-
getReferencedPropertyType
public org.hibernate.type.Type getReferencedPropertyType(String className, String propertyName) throws org.hibernate.MappingException
- Specified by:
getReferencedPropertyType
in interfaceorg.hibernate.engine.spi.Mapping
- Throws:
org.hibernate.MappingException
-
resolveParameterBindType
public org.hibernate.type.Type resolveParameterBindType(Object bindValue)
- Specified by:
resolveParameterBindType
in interfaceorg.hibernate.query.spi.QueryParameterBindingTypeResolver
-
resolveParameterBindType
public org.hibernate.type.Type resolveParameterBindType(Class clazz)
- Specified by:
resolveParameterBindType
in interfaceorg.hibernate.query.spi.QueryParameterBindingTypeResolver
-
-