Uses of Interface
org.hibernate.Session
Packages that useSession Package Description org.hibernate This package defines the central Hibernate APIs, beginning withSessionFactory, which represents an instance of Hibernate at runtime and is the source of new instances ofSessionandStatelessSession, the most important APIs exposing persistence-related operations for entities.org.hibernate.boot.internal org.hibernate.classic This package historically provided backward-compatibility with Hibernate 2.1 APIs which were deprecated in Hibernate 3.org.hibernate.context.internal Internal implementations and support around "current session" handling.org.hibernate.context.spi SPI-level contracts around "current session" and "current tenant" support.org.hibernate.engine.spi This package defines some central internal SPI abstractions used throughout the implementation of Hibernate.org.hibernate.envers org.hibernate.envers.internal.entities.mapper.id org.hibernate.envers.internal.entities.mapper.relation.lazy org.hibernate.envers.internal.reader org.hibernate.envers.internal.revisioninfo org.hibernate.envers.internal.synchronization org.hibernate.envers.internal.synchronization.work org.hibernate.envers.internal.tools.query org.hibernate.envers.strategy org.hibernate.envers.strategy.internal org.hibernate.envers.strategy.spi org.hibernate.event.spi Defines the event types and event listener interfaces for events produced by the statefulSession.org.hibernate.graph Implements and extends the JPA-definedentity graph API.org.hibernate.internal An internal package containing implementations of central Hibernate APIs, mostly defined inorg.hibernate.org.hibernate.procedure.spi Defines an SPI for calling stored procedures and functions.org.hibernate.testing.junit4 org.hibernate.testing.transaction org.hibernate.tuple Most contracts here have been replaced by the new runtimemapping model.Uses ofSession inorg.hibernate
Methods inorg.hibernate that returnSession Modifier and Type Method Description SessionSessionFactory. getCurrentSession()Obtains thecurrent session, an instance ofSessionimplicitly associated with some context or scope.SessionSessionBuilder. openSession()Opens a session with the specified options.SessionSessionFactory. openSession()Open aSession.Methods inorg.hibernate with parameters of typeSession Modifier and Type Method Description booleanCustomEntityDirtinessStrategy. canDirtyCheck(Object entity,EntityPersister persister,Session session)Is this strategy capable of telling whether the given entity is dirty? A return oftruemeans thatCustomEntityDirtinessStrategy.isDirty(java.lang.Object, org.hibernate.persister.entity.EntityPersister, org.hibernate.Session)will be called next as the definitive means to determine whether the entity is dirty.voidCustomEntityDirtinessStrategy. findDirty(Object entity,EntityPersister persister,Session session,CustomEntityDirtinessStrategy.DirtyCheckContext dirtyCheckContext)Callback used to hook into Hibernate algorithm for determination of which attributes have changed.booleanCustomEntityDirtinessStrategy. isDirty(Object entity,EntityPersister persister,Session session)The callback used by Hibernate to determine if the given entity is dirty.voidCustomEntityDirtinessStrategy. resetDirty(Object entity,EntityPersister persister,Session session)Callback used by Hibernate to signal that the entity dirty flag should be cleared.Method parameters inorg.hibernate with type arguments of typeSession Modifier and Type Method Description default <R> RSessionFactory. fromSession(Function<Session,R> action)Open aSessionand use it to obtain a value.default <R> RSessionFactory. fromTransaction(Function<Session,R> action)Open aSessionand use it to obtain a value within the bounds of a transaction.default voidSessionFactory. inSession(Consumer<Session> action)Open aSessionand use it to perform an action.default voidSessionFactory. inTransaction(Consumer<Session> action)Open aSessionand use it to perform an action within the bounds of a transaction.Uses ofSession inorg.hibernate.boot.internal
Methods inorg.hibernate.boot.internal with parameters of typeSession Modifier and Type Method Description booleanDefaultCustomEntityDirtinessStrategy. canDirtyCheck(Object entity,EntityPersister persister,Session session)voidDefaultCustomEntityDirtinessStrategy. findDirty(Object entity,EntityPersister persister,Session session,CustomEntityDirtinessStrategy.DirtyCheckContext dirtyCheckContext)booleanDefaultCustomEntityDirtinessStrategy. isDirty(Object entity,EntityPersister persister,Session session)voidDefaultCustomEntityDirtinessStrategy. resetDirty(Object entity,EntityPersister persister,Session session)Uses ofSession inorg.hibernate.classic
Methods inorg.hibernate.classic with parameters of typeSession Modifier and Type Method Description default booleanLifecycle. onDelete(Session s)Called when an entity is deleted.default voidLifecycle. onLoad(Session s,Serializable id)Deprecated.default voidLifecycle. onLoad(Session s,Object id)Called after an entity is loaded.default booleanLifecycle. onSave(Session s)Called when an entity is saved.default booleanLifecycle. onUpdate(Session s)Called when an entity is passed toSession.update().Uses ofSession inorg.hibernate.context.internal
Methods inorg.hibernate.context.internal that returnSession Modifier and Type Method Description staticSessionManagedSessionContext. bind(Session session)Binds the given session to the current context for its session factory.protectedSessionJTASessionContext. buildOrObtainSession()Strictly provided for subclassing purposes; specifically to allow long-session support.protectedSessionThreadLocalSessionContext. buildOrObtainSession()Strictly provided for sub-classing purposes; specifically to allow long-session support.SessionJTASessionContext. currentSession()SessionManagedSessionContext. currentSession()SessionThreadLocalSessionContext. currentSession()staticSessionManagedSessionContext. unbind(SessionFactory factory)Unbinds the session (if one) current associated with the context for the given session.staticSessionThreadLocalSessionContext. unbind(SessionFactory factory)Disassociates a previously bound session from the current thread of execution.protectedSessionThreadLocalSessionContext. wrap(Session session)Methods inorg.hibernate.context.internal that return types with arguments of typeSession Modifier and Type Method Description protected staticMap<SessionFactory,Session>ManagedSessionContext. sessionMap()protected staticMap<SessionFactory,Session>ThreadLocalSessionContext. sessionMap()Methods inorg.hibernate.context.internal with parameters of typeSession Modifier and Type Method Description staticSessionManagedSessionContext. bind(Session session)Binds the given session to the current context for its session factory.static voidThreadLocalSessionContext. bind(Session session)Associates the given session with the current thread of execution.protectedSessionThreadLocalSessionContext. wrap(Session session)Uses ofSession inorg.hibernate.context.spi
Methods inorg.hibernate.context.spi that returnSession Modifier and Type Method Description SessionCurrentSessionContext. currentSession()Retrieve the current session according to the scoping defined by this implementation.Methods inorg.hibernate.context.spi with parameters of typeSession Modifier and Type Method Description protected voidAbstractCurrentSessionContext. validateExistingSession(Session existingSession)Uses ofSession inorg.hibernate.engine.spi
Subinterfaces ofSession inorg.hibernate.engine.spi Modifier and Type Interface Description interfaceSessionImplementorDefines the "internal contract" betweenSessionand other parts of Hibernate including implementors ofType,EntityPersister, andCollectionPersister.Classes inorg.hibernate.engine.spi that implementSession Modifier and Type Class Description classSessionDelegatorBaseImplA wrapper class that delegates all method invocations to a delegate instance ofSessionImplementor.classSessionLazyDelegatorThis helper class allows decorating a Session instance, while the instance itself is lazily provided via aSupplier.Methods inorg.hibernate.engine.spi that returnSession Modifier and Type Method Description SessionSessionFactoryDelegatingImpl. getCurrentSession()SessionAbstractDelegatingSessionBuilder. openSession()SessionAbstractDelegatingSharedSessionBuilder. openSession()Constructor parameters inorg.hibernate.engine.spi with type arguments of typeSession Constructor Description SessionLazyDelegator(Supplier<Session> lazySessionLookup)Uses ofSession inorg.hibernate.envers
Methods inorg.hibernate.envers with parameters of typeSession Modifier and Type Method Description staticAuditReaderAuditReaderFactory. get(Session session)Create an audit reader associated with an open session.Uses ofSession inorg.hibernate.envers.internal.entities.mapper.id
Methods inorg.hibernate.envers.internal.entities.mapper.id with parameters of typeSession Modifier and Type Method Description default voidIdMapper. mapToMapFromId(Session session,Map<String,Object> data,Object obj)voidMultipleIdMapper. mapToMapFromId(Session session,Map<String,Object> data,Object obj)voidVirtualEntitySingleIdMapper. mapToMapFromId(Session session,Map<String,Object> data,Object obj)Uses ofSession inorg.hibernate.envers.internal.entities.mapper.relation.lazy
Classes inorg.hibernate.envers.internal.entities.mapper.relation.lazy that implementSession Modifier and Type Class Description classAbstractDelegateSessionImplementorclassToOneDelegateSessionImplementorUses ofSession inorg.hibernate.envers.internal.reader
Methods inorg.hibernate.envers.internal.reader that returnSession Modifier and Type Method Description SessionAuditReaderImpl. getSession()SessionAuditReaderImplementor. getSession()Constructors inorg.hibernate.envers.internal.reader with parameters of typeSession Constructor Description AuditReaderImpl(EnversService enversService,Session session,SessionImplementor sessionImplementor)Uses ofSession inorg.hibernate.envers.internal.revisioninfo
Methods inorg.hibernate.envers.internal.revisioninfo with parameters of typeSession Modifier and Type Method Description Query<?>RevisionInfoQueryCreator. getRevisionDateQuery(Session session,Number revision)Query<?>RevisionInfoQueryCreator. getRevisionNumberForDateQuery(Session session,Instant instant)Query<?>RevisionInfoQueryCreator. getRevisionNumberForDateQuery(Session session,LocalDateTime localDateTime)Query<?>RevisionInfoQueryCreator. getRevisionNumberForDateQuery(Session session,Date date)Query<?>RevisionInfoQueryCreator. getRevisionsQuery(Session session,Set<Number> revisions)voidDefaultRevisionInfoGenerator. saveRevisionData(Session session,Object revisionData)voidRevisionInfoGenerator. saveRevisionData(Session session,Object revisionData)Uses ofSession inorg.hibernate.envers.internal.synchronization
Methods inorg.hibernate.envers.internal.synchronization with parameters of typeSession Modifier and Type Method Description voidEntityChangeNotifier. entityChanged(Session session,Object currentRevisionData,AuditWorkUnit vwu)NotifiesRevisionInfoGeneratorabout changes made in the current revision.ObjectAuditProcess. getCurrentRevisionData(Session session, boolean persist)voidSessionCacheCleaner. scheduleAuditDataRemoval(Session session,Object data)Schedules audit data removal from session level cache after transaction completion.Uses ofSession inorg.hibernate.envers.internal.synchronization.work
Methods inorg.hibernate.envers.internal.synchronization.work with parameters of typeSession Modifier and Type Method Description voidAbstractAuditWorkUnit. perform(Session session,Object revisionData)voidAuditWorkUnit. perform(Session session,Object revisionData)Perform this work unit in the given session.voidPersistentCollectionChangeWorkUnit. perform(Session session,Object revisionData)voidAbstractAuditWorkUnit. undo(Session session)voidAuditWorkUnit. undo(Session session)Uses ofSession inorg.hibernate.envers.internal.tools.query
Methods inorg.hibernate.envers.internal.tools.query with parameters of typeSession Modifier and Type Method Description QueryQueryBuilder. toQuery(Session session)QueryUpdateBuilder. toQuery(Session session)Uses ofSession inorg.hibernate.envers.strategy
Methods inorg.hibernate.envers.strategy with parameters of typeSession Modifier and Type Method Description default voidAuditStrategy. perform(Session session,String entityName,EnversService enversService,Object id,Object data,Object revision)default voidAuditStrategy. performCollectionChange(Session session,String entityName,String propertyName,EnversService enversService,PersistentCollectionChangeData persistentCollectionChangeData,Object revision)Uses ofSession inorg.hibernate.envers.strategy.internal
Methods inorg.hibernate.envers.strategy.internal with parameters of typeSession Modifier and Type Method Description voidDefaultAuditStrategy. perform(Session session,String entityName,Configuration configuration,Object id,Object data,Object revision)voidValidityAuditStrategy. perform(Session session,String entityName,Configuration configuration,Object id,Object data,Object revision)voidDefaultAuditStrategy. performCollectionChange(Session session,String entityName,String propertyName,Configuration configuration,PersistentCollectionChangeData persistentCollectionChangeData,Object revision)voidValidityAuditStrategy. performCollectionChange(Session session,String entityName,String propertyName,Configuration configuration,PersistentCollectionChangeData persistentCollectionChangeData,Object revision)Uses ofSession inorg.hibernate.envers.strategy.spi
Methods inorg.hibernate.envers.strategy.spi with parameters of typeSession Modifier and Type Method Description voidAuditStrategy. perform(Session session,String entityName,Configuration configuration,Object id,Object data,Object revision)Perform the persistence of audited data for regular entities.voidAuditStrategy. performCollectionChange(Session session,String entityName,String propertyName,Configuration configuration,PersistentCollectionChangeData persistentCollectionChangeData,Object revision)Perform the persistence of audited data for collection ("middle") entities.Uses ofSession inorg.hibernate.event.spi
Subinterfaces ofSession inorg.hibernate.event.spi Modifier and Type Interface Description interfaceEventSourceUses ofSession inorg.hibernate.graph
Methods inorg.hibernate.graph with parameters of typeSession Modifier and Type Method Description static <T> EntityGraph<T>EntityGraphs. merge(Session session,Class<T> rootType,Graph<T>... graphs)Uses ofSession inorg.hibernate.internal
Classes inorg.hibernate.internal that implementSession Modifier and Type Class Description classSessionImplConcrete implementation of theSessionAPI.Methods inorg.hibernate.internal that returnSession Modifier and Type Method Description SessionSessionFactoryImpl. createEntityManager()SessionSessionFactoryImpl. createEntityManager(SynchronizationType synchronizationType)SessionSessionFactoryImpl. createEntityManager(SynchronizationType synchronizationType,Map map)SessionSessionFactoryImpl. createEntityManager(Map map)SessionSessionFactoryImpl. getCurrentSession()Uses ofSession inorg.hibernate.procedure.spi
Methods inorg.hibernate.procedure.spi with parameters of typeSession Modifier and Type Method Description defaultProcedureCallNamedCallableQueryMemento. makeProcedureCall(Session session)Convert the memento back into an executable (connected) form.Uses ofSession inorg.hibernate.testing.junit4
Fields inorg.hibernate.testing.junit4 declared asSession Modifier and Type Field Description protectedSessionBaseCoreFunctionalTestCase. sessionMethods inorg.hibernate.testing.junit4 that returnSession Modifier and Type Method Description protectedSessionBaseNonConfigCoreFunctionalTestCase. getSession()protectedSessionBaseCoreFunctionalTestCase. openSession()protectedSessionBaseCoreFunctionalTestCase. openSession(Interceptor interceptor)protectedSessionBaseNonConfigCoreFunctionalTestCase. openSession()protectedSessionBaseNonConfigCoreFunctionalTestCase. openSession(Interceptor interceptor)Uses ofSession inorg.hibernate.testing.transaction
Methods inorg.hibernate.testing.transaction with parameters of typeSession Modifier and Type Method Description static voidTransactionUtil. setJdbcTimeout(Session session)Deprecated.static voidTransactionUtil. setJdbcTimeout(Session session, long millis)Deprecated.static voidTransactionUtil. withJdbcTimeout(Session session, long millis,Runnable r)Run the runnable with a session or statement timeoutstatic voidTransactionUtil. withJdbcTimeout(Session session,Runnable r)Run the runnable with a session or statement timeoutMethod parameters inorg.hibernate.testing.transaction with type arguments of typeSession Modifier and Type Method Description static voidTransactionUtil. doInHibernate(Supplier<SessionFactory> factorySupplier,String tenant,Consumer<Session> function)Execute function in a Hibernate transaction without return value and for a given tenantstatic <R> RTransactionUtil. doInHibernate(Supplier<SessionFactory> factorySupplier,String tenant,Function<Session,R> function)Execute function in a Hibernate transaction for a given tenant and return a valuestatic voidTransactionUtil. doInHibernate(Supplier<SessionFactory> factorySupplier,Consumer<Session> function)Uses ofSession inorg.hibernate.tuple
Methods inorg.hibernate.tuple with parameters of typeSession Modifier and Type Method Description TValueGenerator. generateValue(Session session,Object owner)Deprecated, for removal: This API element is subject to removal in a future version.Generate the value.defaultTValueGenerator. generateValue(Session session,Object owner,Object currentValue)Deprecated, for removal: This API element is subject to removal in a future version.Generate the value.