Package io.ebean.annotation
Enum TxIsolation
- java.lang.Object
-
- java.lang.Enum<TxIsolation>
-
- io.ebean.annotation.TxIsolation
-
- All Implemented Interfaces:
Serializable,Comparable<TxIsolation>
public enum TxIsolation extends Enum<TxIsolation>
The Transaction Isolation levels.These match those of java.sql.Connection with the addition of DEFAULT which implies the configured default of the DataSource.
This can be used with TxScope to define transactional scopes to execute method within.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DEFAULTThe default isolation level.NONENo Isolation level.READ_COMMITEDRead Committed Isolation level.READ_UNCOMMITTEDRead uncommitted Isolation level.REPEATABLE_READRepeatable Read Isolation level.SERIALIZABLESerializable Isolation level.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TxIsolationfromLevel(int connectionIsolationLevel)Return the TxIsolation given the java.sql.Connection isolation level.intgetLevel()Return the level as per java.sql.Connection.static TxIsolationvalueOf(String name)Returns the enum constant of this type with the specified name.static TxIsolation[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
READ_COMMITED
public static final TxIsolation READ_COMMITED
Read Committed Isolation level. This is typically the default for most configurations.
-
READ_UNCOMMITTED
public static final TxIsolation READ_UNCOMMITTED
Read uncommitted Isolation level.
-
REPEATABLE_READ
public static final TxIsolation REPEATABLE_READ
Repeatable Read Isolation level.
-
SERIALIZABLE
public static final TxIsolation SERIALIZABLE
Serializable Isolation level.
-
NONE
public static final TxIsolation NONE
No Isolation level.
-
DEFAULT
public static final TxIsolation DEFAULT
The default isolation level. This typically means the default that the DataSource is using or configured to use.
-
-
Method Detail
-
values
public static TxIsolation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TxIsolation c : TxIsolation.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TxIsolation valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getLevel
public int getLevel()
Return the level as per java.sql.Connection.Note that -1 denotes the default isolation level.
-
fromLevel
public static TxIsolation fromLevel(int connectionIsolationLevel)
Return the TxIsolation given the java.sql.Connection isolation level.Note that -1 denotes the default isolation level.
-
-