Class 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 to CacheMode.IGNORE when SessionCacheModeThreadLocal is set to CacheMode.IGNORE
    Since:
    6.14
    See Also:
    Serialized Form
    • Method Detail

      • getSessionFactoryOptions

        public org.hibernate.boot.spi.SessionFactoryOptions getSessionFactoryOptions()
        Specified by:
        getSessionFactoryOptions in interface org.hibernate.SessionFactory
      • getUuid

        public String getUuid()
        Specified by:
        getUuid in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getName

        public String getName()
        Specified by:
        getName in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • withOptions

        public org.hibernate.engine.spi.SessionBuilderImplementor withOptions()
        Specified by:
        withOptions in interface org.hibernate.SessionFactory
        Specified by:
        withOptions in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • openTemporarySession

        public org.hibernate.Session openTemporarySession()
                                                   throws org.hibernate.HibernateException
        Specified by:
        openTemporarySession in interface org.hibernate.engine.spi.SessionFactoryImplementor
        Throws:
        org.hibernate.HibernateException
      • openSession

        public org.hibernate.Session openSession()
                                          throws org.hibernate.HibernateException
        Specified by:
        openSession in interface org.hibernate.SessionFactory
        Throws:
        org.hibernate.HibernateException
      • getCurrentSession

        public org.hibernate.Session getCurrentSession()
                                                throws org.hibernate.HibernateException
        Specified by:
        getCurrentSession in interface org.hibernate.SessionFactory
        Throws:
        org.hibernate.HibernateException
      • withStatelessOptions

        public org.hibernate.StatelessSessionBuilder withStatelessOptions()
        Specified by:
        withStatelessOptions in interface org.hibernate.SessionFactory
      • openStatelessSession

        public org.hibernate.StatelessSession openStatelessSession()
        Specified by:
        openStatelessSession in interface org.hibernate.SessionFactory
      • openStatelessSession

        public org.hibernate.StatelessSession openStatelessSession​(Connection connection)
        Specified by:
        openStatelessSession in interface org.hibernate.SessionFactory
      • getStatistics

        public org.hibernate.stat.spi.StatisticsImplementor getStatistics()
        Specified by:
        getStatistics in interface org.hibernate.SessionFactory
        Specified by:
        getStatistics in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getServiceRegistry

        public org.hibernate.service.spi.ServiceRegistryImplementor getServiceRegistry()
        Specified by:
        getServiceRegistry in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getEventEngine

        public org.hibernate.event.spi.EventEngine getEventEngine()
        Specified by:
        getEventEngine in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getInterceptor

        public org.hibernate.Interceptor getInterceptor()
        Specified by:
        getInterceptor in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getQueryPlanCache

        public org.hibernate.engine.query.spi.QueryPlanCache getQueryPlanCache()
        Specified by:
        getQueryPlanCache in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getNamedQueryRepository

        public org.hibernate.query.spi.NamedQueryRepository getNamedQueryRepository()
        Specified by:
        getNamedQueryRepository in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getFetchProfile

        public org.hibernate.engine.profile.FetchProfile getFetchProfile​(String name)
        Specified by:
        getFetchProfile in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getTypeResolver

        public org.hibernate.type.TypeResolver getTypeResolver()
        Specified by:
        getTypeResolver in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getIdentifierGenerator

        public org.hibernate.id.IdentifierGenerator getIdentifierGenerator​(String rootEntityName)
        Specified by:
        getIdentifierGenerator in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getEntityNotFoundDelegate

        public org.hibernate.proxy.EntityNotFoundDelegate getEntityNotFoundDelegate()
        Specified by:
        getEntityNotFoundDelegate in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getSqlFunctionRegistry

        public org.hibernate.dialect.function.SQLFunctionRegistry getSqlFunctionRegistry()
        Specified by:
        getSqlFunctionRegistry in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • addObserver

        public void addObserver​(org.hibernate.SessionFactoryObserver observer)
        Specified by:
        addObserver in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getCustomEntityDirtinessStrategy

        public org.hibernate.CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy()
        Specified by:
        getCustomEntityDirtinessStrategy in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getCurrentTenantIdentifierResolver

        public org.hibernate.context.spi.CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver()
        Specified by:
        getCurrentTenantIdentifierResolver in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getFastSessionServices

        public org.hibernate.internal.FastSessionServices getFastSessionServices()
        Specified by:
        getFastSessionServices in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getDeserializationResolver

        public org.hibernate.engine.spi.SessionFactoryImplementor.DeserializationResolver getDeserializationResolver()
        Specified by:
        getDeserializationResolver in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getJdbcServices

        public org.hibernate.engine.jdbc.spi.JdbcServices getJdbcServices()
        Specified by:
        getJdbcServices in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getSqlStringGenerationContext

        public org.hibernate.boot.model.relational.SqlStringGenerationContext getSqlStringGenerationContext()
        Specified by:
        getSqlStringGenerationContext in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getSettings

        public org.hibernate.cfg.Settings getSettings()
        Specified by:
        getSettings in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • close

        public void close()
                   throws org.hibernate.HibernateException
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface javax.persistence.EntityManagerFactory
        Specified by:
        close in interface org.hibernate.SessionFactory
        Throws:
        org.hibernate.HibernateException
      • getProperties

        public Map<String,​Object> getProperties()
        Specified by:
        getProperties in interface javax.persistence.EntityManagerFactory
      • isClosed

        public boolean isClosed()
        Specified by:
        isClosed in interface org.hibernate.SessionFactory
      • getCache

        public org.hibernate.cache.spi.CacheImplementor getCache()
        Specified by:
        getCache in interface javax.persistence.EntityManagerFactory
        Specified by:
        getCache in interface org.hibernate.SessionFactory
        Specified by:
        getCache in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • getPersistenceUnitUtil

        public javax.persistence.PersistenceUnitUtil getPersistenceUnitUtil()
        Specified by:
        getPersistenceUnitUtil in interface javax.persistence.EntityManagerFactory
      • addNamedQuery

        public void addNamedQuery​(String s,
                                  javax.persistence.Query query)
        Specified by:
        addNamedQuery in interface javax.persistence.EntityManagerFactory
      • unwrap

        public <T> T unwrap​(Class<T> aClass)
        Specified by:
        unwrap in interface javax.persistence.EntityManagerFactory
      • addNamedEntityGraph

        public <T> void addNamedEntityGraph​(String s,
                                            javax.persistence.EntityGraph<T> entityGraph)
        Specified by:
        addNamedEntityGraph in interface javax.persistence.EntityManagerFactory
      • getDefinedFilterNames

        public Set getDefinedFilterNames()
        Specified by:
        getDefinedFilterNames in interface org.hibernate.SessionFactory
      • getFilterDefinition

        public org.hibernate.engine.spi.FilterDefinition getFilterDefinition​(String filterName)
                                                                      throws org.hibernate.HibernateException
        Specified by:
        getFilterDefinition in interface org.hibernate.SessionFactory
        Throws:
        org.hibernate.HibernateException
      • containsFetchProfileDefinition

        public boolean containsFetchProfileDefinition​(String name)
        Specified by:
        containsFetchProfileDefinition in interface org.hibernate.SessionFactory
      • getTypeHelper

        public org.hibernate.TypeHelper getTypeHelper()
        Specified by:
        getTypeHelper in interface org.hibernate.SessionFactory
      • getClassMetadata

        public org.hibernate.metadata.ClassMetadata getClassMetadata​(Class entityClass)
        Specified by:
        getClassMetadata in interface org.hibernate.SessionFactory
      • getClassMetadata

        public org.hibernate.metadata.ClassMetadata getClassMetadata​(String entityName)
        Specified by:
        getClassMetadata in interface org.hibernate.SessionFactory
      • getCollectionMetadata

        public org.hibernate.metadata.CollectionMetadata getCollectionMetadata​(String roleName)
        Specified by:
        getCollectionMetadata in interface org.hibernate.SessionFactory
      • getAllClassMetadata

        public Map<String,​org.hibernate.metadata.ClassMetadata> getAllClassMetadata()
        Specified by:
        getAllClassMetadata in interface org.hibernate.SessionFactory
      • getAllCollectionMetadata

        public Map getAllCollectionMetadata()
        Specified by:
        getAllCollectionMetadata in interface org.hibernate.SessionFactory
      • findEntityGraphsByType

        public <T> List<javax.persistence.EntityGraph<? super T>> findEntityGraphsByType​(Class<T> entityClass)
        Specified by:
        findEntityGraphsByType in interface org.hibernate.jpa.HibernateEntityManagerFactory
        Specified by:
        findEntityGraphsByType in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • findEntityGraphsByJavaType

        public <T> List<org.hibernate.graph.spi.RootGraphImplementor<? super T>> findEntityGraphsByJavaType​(Class<T> aClass)
        Specified by:
        findEntityGraphsByJavaType in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • createEntityManager

        public javax.persistence.EntityManager createEntityManager()
        Specified by:
        createEntityManager in interface javax.persistence.EntityManagerFactory
      • createEntityManager

        public javax.persistence.EntityManager createEntityManager​(Map map)
        Specified by:
        createEntityManager in interface javax.persistence.EntityManagerFactory
      • createEntityManager

        public javax.persistence.EntityManager createEntityManager​(javax.persistence.SynchronizationType synchronizationType)
        Specified by:
        createEntityManager in interface javax.persistence.EntityManagerFactory
      • createEntityManager

        public javax.persistence.EntityManager createEntityManager​(javax.persistence.SynchronizationType synchronizationType,
                                                                   Map map)
        Specified by:
        createEntityManager in interface javax.persistence.EntityManagerFactory
      • getCriteriaBuilder

        public javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
        Specified by:
        getCriteriaBuilder in interface javax.persistence.EntityManagerFactory
      • getMetamodel

        public org.hibernate.metamodel.spi.MetamodelImplementor getMetamodel()
        Specified by:
        getMetamodel in interface javax.persistence.EntityManagerFactory
        Specified by:
        getMetamodel in interface org.hibernate.jpa.HibernateEntityManagerFactory
        Specified by:
        getMetamodel in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • findEntityGraphByName

        public org.hibernate.graph.spi.RootGraphImplementor<?> findEntityGraphByName​(String name)
        Specified by:
        findEntityGraphByName in interface org.hibernate.engine.spi.SessionFactoryImplementor
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface javax.persistence.EntityManagerFactory
      • getIdentifierGeneratorFactory

        public org.hibernate.id.factory.IdentifierGeneratorFactory getIdentifierGeneratorFactory()
        Specified by:
        getIdentifierGeneratorFactory in interface org.hibernate.engine.spi.Mapping
      • getIdentifierType

        public org.hibernate.type.Type getIdentifierType​(String className)
                                                  throws org.hibernate.MappingException
        Specified by:
        getIdentifierType in interface org.hibernate.engine.spi.Mapping
        Throws:
        org.hibernate.MappingException
      • getIdentifierPropertyName

        public String getIdentifierPropertyName​(String className)
                                         throws org.hibernate.MappingException
        Specified by:
        getIdentifierPropertyName in interface org.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 interface org.hibernate.engine.spi.Mapping
        Throws:
        org.hibernate.MappingException
      • resolveParameterBindType

        public org.hibernate.type.Type resolveParameterBindType​(Object bindValue)
        Specified by:
        resolveParameterBindType in interface org.hibernate.query.spi.QueryParameterBindingTypeResolver
      • resolveParameterBindType

        public org.hibernate.type.Type resolveParameterBindType​(Class clazz)
        Specified by:
        resolveParameterBindType in interface org.hibernate.query.spi.QueryParameterBindingTypeResolver