程序包 org.hibernate
枚举 FlushMode
- java.lang.Object
-
- java.lang.Enum<FlushMode>
-
- org.hibernate.FlushMode
-
- 所有已实现的接口:
Serializable,Comparable<FlushMode>
public enum FlushMode extends Enum<FlushMode>
Represents a flushing strategy. The flush process synchronizes database state with session state by detecting state changes and executing SQL statements.- 作者:
- Gavin King
- 另请参阅:
Session.setFlushMode(FlushMode),Query.setFlushMode(FlushMode),Criteria.setFlushMode(FlushMode)
-
-
枚举常量概要
枚举常量 枚举常量 说明 ALWAYSTheSessionis flushed before every query.AUTOTheSessionis sometimes flushed before query execution in order to ensure that queries never return stale state.COMMITTheSessionis flushed whenEntityTransaction.commit()is called.MANUALTheSessionis only ever flushed whenSession.flush()is explicitly called by the application.
-
方法概要
所有方法 静态方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 static FlushModeinterpretExternalSetting(String externalName)Interprets an external representation of the flush mode.static booleanisManualFlushMode(FlushMode mode)已过时。Just use equality check againstMANUAL.booleanlessThan(FlushMode other)Checks to see ifthisflush mode is less than the given flush mode.static FlushModevalueOf(String name)返回带有指定名称的该类型的枚举常量。static FlushMode[]values()按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。
-
-
-
枚举常量详细资料
-
MANUAL
public static final FlushMode MANUAL
TheSessionis only ever flushed whenSession.flush()is explicitly called by the application. This mode is very efficient for read only transactions.
-
COMMIT
public static final FlushMode COMMIT
TheSessionis flushed whenEntityTransaction.commit()is called.
-
AUTO
public static final FlushMode AUTO
TheSessionis sometimes flushed before query execution in order to ensure that queries never return stale state. This is the default flush mode.
-
-
方法详细资料
-
values
public static FlushMode[] values()
按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。该方法可用于迭代 常量, 如下所示:for (FlushMode c : FlushMode.values()) System.out.println(c);
- 返回:
- 按照声明该枚举类型的常量的顺序返回的包含这些常量的数组
-
valueOf
public static FlushMode valueOf(String name)
返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)- 参数:
name- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
IllegalArgumentException- 如果该枚举类型没有带有指定名称的常量NullPointerException- 如果参数为空值
-
lessThan
public boolean lessThan(FlushMode other)
Checks to see ifthisflush mode is less than the given flush mode.- 参数:
other- THe flush mode value to be checked againstthis- 返回:
trueindicatesotheris less thanthis;falseotherwise
-
isManualFlushMode
@Deprecated public static boolean isManualFlushMode(FlushMode mode)
已过时。Just use equality check againstMANUAL. Legacy from before this was an enumChecks to see if the given mode is the same asMANUAL.- 参数:
mode- The mode to check- 返回:
- true/false
-
interpretExternalSetting
public static FlushMode interpretExternalSetting(String externalName)
Interprets an external representation of the flush mode.nullis returned asnull, otherwisevalueOf(String)is used with the upper-case version of the incoming value. An unknown, non-null value results in a MappingException being thrown.- 参数:
externalName- The external representation- 返回:
- The interpreted FlushMode value.
- 抛出:
MappingException- Indicates an unrecognized external representation
-
-