It seems it can't set in xml,but set in application like this:
query.setCacheable(); This cache's scope like Second-level cache,live among SessionFaction lifecycle( work in all sessionFactory lifecycle).it means even open a new session after another close,it also validate.The cache will be evict when the object changed.if the associated object changed,the Query cache will not work.
if the first queryed obejct update ,second query object also use query cache and get the updated value,just like
Second-Level cache.
posted on 2006-08-30 20:16
R.Zeus 阅读(219)
评论(0) 编辑 收藏 所属分类:
Hibernate