com.wideplay.warp.persist
Enum TransactionType

java.lang.Object
  extended by java.lang.Enum<TransactionType>
      extended by com.wideplay.warp.persist.TransactionType
All Implemented Interfaces:
Serializable, Comparable<TransactionType>

public enum TransactionType
extends Enum<TransactionType>

Enumerates options for an experimental feature: read/write or read/only transactions. Currently *not* supported in JPA and experimental in Hibernate. The underlying mechanism actually alters the session-flush state to manual and silently ignores the flush on commit. The dirty state of the same session in subsequent transactions may be affected. Use with caution.

Prefer driver-level read only transactions if your database supports it (using JTA global transactions).


Enum Constant Summary
READ_ONLY
          Used to instruct warp-persist in the @Transactional annotation of methods/classes that this transaction is READ-ONLY.
READ_WRITE
          Used to instruct warp-persist in the @Transactional annotation of methods/classes that this transaction is READ-WRITE.
 
Method Summary
static TransactionType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static TransactionType[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

READ_ONLY

public static final TransactionType READ_ONLY
Used to instruct warp-persist in the @Transactional annotation of methods/classes that this transaction is READ-ONLY. This feature is not supported for JPA and is experimental for Hibernate.


READ_WRITE

public static final TransactionType READ_WRITE
Used to instruct warp-persist in the @Transactional annotation of methods/classes that this transaction is READ-WRITE. It is redundant to use this enum explicitly, since all transactions are read-write by default.

Method Detail

values

public static final TransactionType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(TransactionType c : TransactionType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static TransactionType 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 name