public enum TranPolicy extends Enum<TranPolicy>
| Enum Constant and Description |
|---|
mandatory
支持当前事务,如果没有事务则报错
|
nested
如果当前有事务,则在当前事务内部嵌套一个事务;否则新建事务(需要入栈)
|
never
以无事务的方式执行,如果当前有事务则报错
|
not_supported
以无事务的方式执行,如果当前有事务则将其挂起
|
required
默认。
|
requires_new
新建一个事务,同时将当前事务挂起(需要入栈)
|
supports
支持当前事务,如果没有则不使用事务
|
| Modifier and Type | Field and Description |
|---|---|
int |
code |
| Modifier and Type | Method and Description |
|---|---|
static TranPolicy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TranPolicy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TranPolicy required
public static final TranPolicy requires_new
public static final TranPolicy nested
public static final TranPolicy mandatory
public static final TranPolicy supports
public static final TranPolicy not_supported
public static final TranPolicy never
public static TranPolicy[] values()
for (TranPolicy c : TranPolicy.values()) System.out.println(c);
public static TranPolicy valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2025. All rights reserved.