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 final class SwitchableCachingSessionFactory
    extends org.hibernate.engine.spi.SessionFactoryDelegatingImpl
    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
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.hibernate.engine.spi.SessionFactoryImplementor

        org.hibernate.engine.spi.SessionFactoryImplementor.DeserializationResolver<T extends org.hibernate.engine.spi.SessionFactoryImplementor>
    • Constructor Summary

      Constructors 
      Constructor Description
      SwitchableCachingSessionFactory​(org.hibernate.engine.spi.SessionFactoryImplementor delegate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.hibernate.Session getCurrentSession()  
      org.hibernate.Session openSession()  
      org.hibernate.Session openTemporarySession()  
      org.hibernate.engine.spi.SessionBuilderImplementor withOptions()  
      • Methods inherited from class org.hibernate.engine.spi.SessionFactoryDelegatingImpl

        addNamedEntityGraph, addNamedQuery, addObserver, close, containsFetchProfileDefinition, createEntityManager, createEntityManager, createEntityManager, createEntityManager, delegate, findEntityGraphByName, findEntityGraphsByJavaType, getAllClassMetadata, getAllCollectionMetadata, getCache, getClassMetadata, getClassMetadata, getCollectionMetadata, getCollectionPersister, getCollectionPersisters, getCollectionRolesByEntityParticipant, getCriteriaBuilder, getCurrentTenantIdentifierResolver, getCustomEntityDirtinessStrategy, getDefinedFilterNames, getDeserializationResolver, getDialect, getEntityNotFoundDelegate, getEntityPersister, getEntityPersisters, getEventEngine, getFastSessionServices, getFetchProfile, getFilterDefinition, getIdentifierGenerator, getIdentifierGeneratorFactory, getIdentifierPropertyName, getIdentifierType, getImplementors, getImportedClassName, getInterceptor, getJdbcServices, getMetamodel, getName, getNamedQuery, getNamedQueryRepository, getNamedSQLQuery, getPersistenceUnitUtil, getProperties, getQueryPlanCache, getReference, getReferencedPropertyType, getResultSetMapping, getReturnAliases, getReturnTypes, getServiceRegistry, getSessionFactoryOptions, getSettings, getSQLExceptionConverter, getSQLExceptionHelper, getSqlFunctionRegistry, getSqlStringGenerationContext, getStatistics, getStatisticsImplementor, getTypeHelper, getTypeResolver, getUuid, isClosed, isOpen, iterateEntityNameResolvers, locateEntityPersister, locateEntityPersister, openStatelessSession, openStatelessSession, registerNamedQueryDefinition, registerNamedSQLQueryDefinition, resolveParameterBindType, resolveParameterBindType, unwrap, withStatelessOptions
      • Methods inherited from interface org.hibernate.jpa.HibernateEntityManagerFactory

        getEntityManagerFactoryName, getEntityTypeByName, getSessionFactory
      • Methods inherited from interface org.hibernate.engine.spi.SessionFactoryImplementor

        findEntityGraphsByType
    • Constructor Detail

      • SwitchableCachingSessionFactory

        public SwitchableCachingSessionFactory​(org.hibernate.engine.spi.SessionFactoryImplementor delegate)
    • Method Detail

      • 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
        Overrides:
        withOptions in class org.hibernate.engine.spi.SessionFactoryDelegatingImpl
      • openTemporarySession

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

        public org.hibernate.Session openSession()
                                          throws org.hibernate.HibernateException
        Specified by:
        openSession in interface org.hibernate.SessionFactory
        Overrides:
        openSession in class org.hibernate.engine.spi.SessionFactoryDelegatingImpl
        Throws:
        org.hibernate.HibernateException
      • getCurrentSession

        public org.hibernate.Session getCurrentSession()
                                                throws org.hibernate.HibernateException
        Specified by:
        getCurrentSession in interface org.hibernate.SessionFactory
        Overrides:
        getCurrentSession in class org.hibernate.engine.spi.SessionFactoryDelegatingImpl
        Throws:
        org.hibernate.HibernateException