public class EnversSessionFactoryScope extends Object implements SessionFactoryAccess
NAMESPACE| Constructor and Description |
|---|
EnversSessionFactoryScope(EnversSessionFactoryProducer producer,
Strategy auditStrategy) |
| Modifier and Type | Method and Description |
|---|---|
org.hibernate.engine.spi.SessionFactoryImplementor |
getSessionFactory() |
void |
inAuditReader(Consumer<org.hibernate.envers.AuditReader> action)
Invoke a lambda action against an
AuditReader bound to a newly allocated session. |
void |
inSession(Consumer<org.hibernate.engine.spi.SessionImplementor> action)
Invoke a lambda action inside an open session without a transaction-scope.
|
<R> R |
inSession(Function<org.hibernate.engine.spi.SessionImplementor,R> action) |
void |
inSession(org.hibernate.engine.spi.SessionFactoryImplementor sfi,
Consumer<org.hibernate.engine.spi.SessionImplementor> action)
Invoke a lambda action with an open session without a transaction-scope.
|
<R> R |
inSession(org.hibernate.engine.spi.SessionFactoryImplementor sfi,
Function<org.hibernate.engine.spi.SessionImplementor,R> action) |
void |
inTransaction(Consumer<org.hibernate.engine.spi.SessionImplementor> action)
Invoke a lambda action with an open session inside a new transaction.
|
<R> R |
inTransaction(Function<org.hibernate.engine.spi.SessionImplementor,R> action) |
void |
inTransaction(org.hibernate.engine.spi.SessionFactoryImplementor sfi,
Consumer<org.hibernate.engine.spi.SessionImplementor> action)
Invoke a lambda action with an open session inside a new transaction.
|
<R> R |
inTransaction(org.hibernate.engine.spi.SessionFactoryImplementor sfi,
Function<org.hibernate.engine.spi.SessionImplementor,R> action) |
void |
inTransaction(org.hibernate.engine.spi.SessionImplementor session,
Consumer<org.hibernate.engine.spi.SessionImplementor> action)
Invoke a lambda action inside a new transaction but bound to an existing open session.
|
<R> R |
inTransaction(org.hibernate.engine.spi.SessionImplementor session,
Function<org.hibernate.engine.spi.SessionImplementor,R> action) |
void |
inTransactions(Consumer<org.hibernate.engine.spi.SessionImplementor>... actions)
Invoke a series of lambda actions bound inside their own transaction-scope but bound to the same session.
|
void |
releaseSessionFactory() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDialectpublic EnversSessionFactoryScope(EnversSessionFactoryProducer producer, Strategy auditStrategy)
public void releaseSessionFactory()
public org.hibernate.engine.spi.SessionFactoryImplementor getSessionFactory()
getSessionFactory in interface SessionFactoryAccesspublic void inSession(Consumer<org.hibernate.engine.spi.SessionImplementor> action)
action - The lambda action to invoke.public void inSession(org.hibernate.engine.spi.SessionFactoryImplementor sfi,
Consumer<org.hibernate.engine.spi.SessionImplementor> action)
sfi - The session factory.action - The lambda action to invoke.public <R> R inSession(Function<org.hibernate.engine.spi.SessionImplementor,R> action)
public <R> R inSession(org.hibernate.engine.spi.SessionFactoryImplementor sfi,
Function<org.hibernate.engine.spi.SessionImplementor,R> action)
public void inTransaction(Consumer<org.hibernate.engine.spi.SessionImplementor> action)
action - The lambda action to invoke.public void inTransaction(org.hibernate.engine.spi.SessionFactoryImplementor sfi,
Consumer<org.hibernate.engine.spi.SessionImplementor> action)
sfi - The session factory.action - The lambda action to invoke.public void inTransaction(org.hibernate.engine.spi.SessionImplementor session,
Consumer<org.hibernate.engine.spi.SessionImplementor> action)
session - The session to bind the transaction against.action - The lambda action to invoke.public <R> R inTransaction(Function<org.hibernate.engine.spi.SessionImplementor,R> action)
public <R> R inTransaction(org.hibernate.engine.spi.SessionFactoryImplementor sfi,
Function<org.hibernate.engine.spi.SessionImplementor,R> action)
public <R> R inTransaction(org.hibernate.engine.spi.SessionImplementor session,
Function<org.hibernate.engine.spi.SessionImplementor,R> action)
@SafeVarargs public final void inTransactions(Consumer<org.hibernate.engine.spi.SessionImplementor>... actions)
actions - The lambda actions to invoke.public void inAuditReader(Consumer<org.hibernate.envers.AuditReader> action)
AuditReader bound to a newly allocated session.
The audit reader instance will be automatically allocated and provided to the lambda.
The underlying session will be automatically opened and closed.action - The lambda action to invoke.Copyright © 2001-2019 Red Hat, Inc. All Rights Reserved.