|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.avaje.ebean.TxScope
public final class TxScope
Holds the definition of how a transactional method should run.
This information matches the features of the Transactional annotation. You
can use it directly with TxRunnable or TxCallable via
Ebean.execute(TxScope, TxCallable)
or
Ebean.execute(TxScope, TxRunnable)
.
This object is used internally with the enhancement of a method with Transactional annotation.
TxCallable
,
TxRunnable
,
Ebean.execute(TxScope, TxCallable)
,
Ebean.execute(TxScope, TxRunnable)
Constructor Summary | |
---|---|
TxScope()
Create a REQUIRED transaction scope. |
|
TxScope(TxType type)
Create with a given transaction scope type. |
Method Summary | |
---|---|
TxIsolation |
getIsolation()
Return the Isolation level this transaction should run with. |
ArrayList<Class<? extends Throwable>> |
getNoRollbackFor()
Return the throwable's that should NOT cause a rollback. |
ArrayList<Class<? extends Throwable>> |
getRollbackFor()
Return the throwable's that should cause a rollback. |
String |
getServerName()
Return the serverName for this transaction. |
TxType |
getType()
Return the transaction type. |
boolean |
isReadonly()
Return if the transaction should be treated as read only. |
static TxScope |
mandatory()
Helper method to create a TxScope with MANDATORY. |
static TxScope |
never()
Helper method to create a TxScope with NEVER. |
static TxScope |
notSupported()
Helper method to create a TxScope with NOT_SUPPORTED. |
static TxScope |
required()
Helper method to create a TxScope with REQUIRES. |
static TxScope |
requiresNew()
Helper method to create a TxScope with REQUIRES_NEW. |
TxScope |
setIsolation(TxIsolation isolation)
Set the transaction isolation level this transaction should run with. |
TxScope |
setNoRollbackFor(Class<?>[] noRollbacks)
Set multiple throwable's that will NOT cause a rollback. |
TxScope |
setNoRollbackFor(Class<? extends Throwable> noRollback)
Add a Throwable to a list that will NOT cause a rollback. |
TxScope |
setReadOnly(boolean readOnly)
Set if the transaction should be treated as read only. |
TxScope |
setRollbackFor(Class<?>[] rollbackThrowables)
Set multiple throwable's that will cause a rollback. |
TxScope |
setRollbackFor(Class<? extends Throwable> rollbackThrowable)
Set a Throwable that should explicitly cause a rollback. |
TxScope |
setServerName(String serverName)
Set the serverName (DataSource name) for which this transaction will be. |
TxScope |
setType(TxType type)
Set the transaction type. |
static TxScope |
supports()
Helper method to create a TxScope with SUPPORTS. |
String |
toString()
Describes this TxScope instance. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TxScope()
public TxScope(TxType type)
Method Detail |
---|
public static TxScope required()
public static TxScope requiresNew()
public static TxScope mandatory()
public static TxScope supports()
public static TxScope notSupported()
public static TxScope never()
public String toString()
toString
in class Object
public TxType getType()
public TxScope setType(TxType type)
public boolean isReadonly()
public TxScope setReadOnly(boolean readOnly)
public TxIsolation getIsolation()
public TxScope setIsolation(TxIsolation isolation)
public String getServerName()
public TxScope setServerName(String serverName)
public ArrayList<Class<? extends Throwable>> getRollbackFor()
public TxScope setRollbackFor(Class<? extends Throwable> rollbackThrowable)
public TxScope setRollbackFor(Class<?>[] rollbackThrowables)
public ArrayList<Class<? extends Throwable>> getNoRollbackFor()
public TxScope setNoRollbackFor(Class<? extends Throwable> noRollback)
public TxScope setNoRollbackFor(Class<?>[] noRollbacks)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |