Package com.googlecode.objectify
Enum TxnType
- java.lang.Object
-
- java.lang.Enum<TxnType>
-
- com.googlecode.objectify.TxnType
-
- All Implemented Interfaces:
Serializable
,Comparable<TxnType>
public enum TxnType extends Enum<TxnType>
Just like the EJB options. See http://docs.oracle.com/javaee/6/api/javax/ejb/TransactionAttributeType.html- Author:
- Jeff Schnitzer
-
-
Enum Constant Summary
Enum Constants Enum Constant Description MANDATORY
Require that there must already be a transaction running.NEVER
Require that there must NOT be a transaction running.NOT_SUPPORTED
Execute the work without a transaction, pausing an existing transaction if there is one.REQUIRED
Use the existing transaction (if present), or start a new transaction if not.REQUIRES_NEW
Start a new transaction, pausing the old one.SUPPORTS
Inherits previous transaction state.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TxnType
valueOf(String name)
Returns the enum constant of this type with the specified name.static TxnType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MANDATORY
public static final TxnType MANDATORY
Require that there must already be a transaction running. If no transaction, throw an IllegalStateException.
-
NEVER
public static final TxnType NEVER
Require that there must NOT be a transaction running. If there is, throw an IllegalStateException.
-
NOT_SUPPORTED
public static final TxnType NOT_SUPPORTED
Execute the work without a transaction, pausing an existing transaction if there is one.
-
REQUIRED
public static final TxnType REQUIRED
Use the existing transaction (if present), or start a new transaction if not.
-
REQUIRES_NEW
public static final TxnType REQUIRES_NEW
Start a new transaction, pausing the old one.
-
SUPPORTS
public static final TxnType SUPPORTS
Inherits previous transaction state.
-
-
Method Detail
-
values
public static TxnType[] 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 (TxnType c : TxnType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TxnType 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
-
-