FlushModeType (Java EE 5)

Java EE API


javax.persistence Enum FlushModeType

java.lang.Object
  extended by java.lang.Enum<FlushModeType>
      extended by javax.persistence.FlushModeType
All Implemented Interfaces:
Serializable, Comparable<FlushModeType>

public enum FlushModeType
extends Enum<FlushModeType>

Extends: Enum<E>

刷新模式设置。

在事务中执行查询时,如果对 Query 对象设置了 FlushModeType.AUTO,或者持久性上下文的刷新模式设置为 AUTO(默认)并且没有对 Query 对象指定刷新模式设置,则持久性提供者负责确保,对持久性上下文中所有实体状态所作的所有可能影响查询结果的更新对于查询处理都是可见的。持久性提供者实现可能通过将这些实体刷新到数据库(或其他方式)实现这一点。如果设置了 FlushModeType.COMMIT,则对持久性上下文中的实体所作的更新对查询的影响是不明确的。

如果没有处于活动状态的事务,则持久性提供者不得刷新到数据库。

英文文档:

Flush mode setting.

When queries are executed within a transaction, if FlushModeType.AUTO is set on the Query object, or if the flush mode setting for the persistence context is AUTO (the default) and a flush mode setting has not been specified for the Query object, the persistence provider is responsible for ensuring that all updates to the state of all entities in the persistence context which could potentially affect the result of the query are visible to the processing of the query. The persistence provider implementation may achieve this by flushing those entities to the database or by some other means. If FlushModeType.COMMIT is set, the effect of updates made to entities in the persistence context upon queries is unspecified.

If there is no transaction active, the persistence provider must not flush to the database.

Since:
Java Persistence 1.0

Enum Constant Summary
 
Method Summary
static FlushModeType
static FlushModeType[]
 
Methods inherited from class java.lang.Enum
 
Methods inherited from class java.lang.Object
 

Enum Constant Detail

英文文档:

COMMIT

public static final FlushModeType COMMIT
Flushing must occur only at transaction commit


英文文档:

AUTO

public static final FlushModeType AUTO
(Default) Flushing to occur at query execution

Method Detail

final public static FlushModeType[] values()
英文文档:

values

public static final FlushModeType[] 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(FlushModeType c : FlushModeType.values())
        System.out.println(c);

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

public static FlushModeType valueOf(String name)
英文文档:

valueOf

public static FlushModeType 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


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!