枚举常量概要
枚举常量
如果当前存在事务,则在嵌套事务内执行,如果当前没有事务,就新建一个事务。
以非事务方式执行操作,如果当前存在事务,就把当前事务挂起。
支持当前事务,如果当前没有事务,就以非事务方式执行。
方法概要
所有方法 静态方法 具体方法
Returns the enum constant of this class with the specified name.
Returns an array containing the constants of this enum class, in
the order they are declared.
从类继承的方法 java.lang.Enum
clone , compareTo , describeConstable , equals , finalize , getDeclaringClass , hashCode , name , ordinal , toString , valueOf
枚举常量详细资料
REQUIRED
支持当前事务,如果当前没有事务,就新建一个事务。这是最常见的选择。
REQUIRES_NEW
新建事务,如果当前存在事务,把当前事务挂起。
NOT_SUPPORTED
以非事务方式执行操作,如果当前存在事务,就把当前事务挂起。
SUPPORTS
支持当前事务,如果当前没有事务,就以非事务方式执行。
NEVER
以非事务方式执行,如果当前存在事务,则抛出异常。
MANDATORY
支持当前事务,如果当前没有事务,就抛出异常。
NESTED
如果当前存在事务,则在嵌套事务内执行,如果当前没有事务,就新建一个事务。
方法详细资料
values
Returns an array containing the constants of this enum class, in
the order they are declared.
返回:
an array containing the constants of this enum class, in the order they are declared
valueOf
Returns the enum constant of this class with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this class. (Extraneous whitespace characters are
not permitted.)
参数:
name - 要返回的枚举常量的名称。
返回:
返回带有指定名称的枚举常量
抛出:
IllegalArgumentException - if this enum class has no constant with the specified name
NullPointerException - 如果参数为空值