码迷,mamicode.com
首页 > 其他好文 > 详细

FlushMode属性..

时间:2015-09-20 06:54:58      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:

一、参见hibernate的api

http://tool.oschina.net/apidocs/apidoc?api=hibernate-3.6.10

http://tool.oschina.net/apidocs/apidoc?api=hibernate-4.1.4

说明:贴出两个版本的原因在于FlushMode属性在3.6与4.1版本的设置有所不同,3.6的FlushMode属性是一个Class类,而4.1已更换了Enum。

二、 FlushMode属性

在org.hibernate Class FlushMode中这样解释它的作用:Represents a flushing strategy. The flush process synchronizes database state with session state by detecting state changes and executing SQL statements.

代表一个flushing(译作刷新或清空似乎都不合适,暂理解为刷新)的策略,它将通过改变session的状态和执行SQL的状态来处理线程中的数据。 

static FlushMode ALWAYS 
          The Session is flushed before every query.
static FlushMode AUTO 
          The Session is sometimes flushed before query execution in order to ensure that queries never return stale state.
static FlushMode COMMIT 
          The Session is flushed when Transaction.commit() is called.
static FlushMode MANUAL 
          The Session is only ever flushed when Session.flush() is explicitly called by the application.
static FlushMode NEVER 
          Deprecated. use MANUAL instead.

 

 

 

FlushMode属性有五个,分别是:

..

鸣谢:http://blog.csdn.net/accpsz/article/details/6010618

FlushMode属性..

标签:

原文地址:http://www.cnblogs.com/wql025/p/4822791.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!