criteria.setCacheable(true);

一下是Criteria的底层源代码

/**
* Enable caching of this query result, provided query caching is enabled
* for the underlying session factory.
*
* @param cacheable Should the result be considered cacheable; default is
* to not cache (false).
* @return this (for method chaining)
*/
public Criteria setCacheable(boolean cacheable);

意思是:

启用查询缓存结果,提供查询缓存
*为底层会话工厂。
*
* @param缓存的结果应该被认为是默认缓存;
*不缓存(false)。
*“退货(方法链接)

就是给criteria一个缓存

criteria.setCacheable(true);这个方法是干什么用的的更多相关文章

  1. struts.enable.DynamicMethodInvocation = true 动态方法调用

    default.properties 在Struts 2的核心jar包-struts2-core中,有一个default.properties的默认配置文件.里面配置了一些全局的信息,比如: stru ...

  2. struts.enable.DynamicMethodInvocation = true 动态方法调用(转)

    原文地址:http://blog.csdn.net/wfcaven/article/details/5937557 default.properties 在Struts 2的核心jar包-struts ...

  3. 对比两个String无规律包含连续4个相同字符返回true的方法

    package com.qif.dsa.util; import java.util.ArrayList; import java.util.List; /** * @author * @Title: ...

  4. DropDownList 需要加AutoPostBack="true" ,OnSelectedIndexChanged方法才有效

    <asp:DropDownList ID="ddlType" runat="server"  AutoPostBack="True"  ...

  5. Spring MVC模式下,获取WebApplicationContext的工具类 方法

    在已有的注解类型下,获取WebApplicationContext的工具类 通过  WebApplicationContextUtils.getRequiredWebApplicationContex ...

  6. Hibernate缓存机制简述 (转)

    感谢:http://blog.csdn.net/ramln1989/article/details/5528445 ------------------------------------------ ...

  7. 传智博客(JavaWeb方面的所有知识)听课记录(经典)

    一.       JavaWeb基础 第一天: 1.Eclipse详解: (1).Bad versionnumber in .class file:编译器版本和运行(JRE)版本不符合.高的JRE版本 ...

  8. 20160512--hibernate--缓存

    缓存 缓存的作用主要用来提高性能,可以简单的理解成一个Map:使用缓存涉及到三个操作:把数据放入缓存.从缓存中获取数据.删除缓存中的无效数据.   原理模拟分析:(不能运行,只是模拟)(缓存实现复杂, ...

  9. hibernate详解

    Hibernate原理与应用 主要内容 1.引入 2.安装配置 3.基本概念和CURD 4.HQL和Criteria 5.关联映射 6.继承映射 7.集合映射 8.懒加载 9.缓存 10.事务 11. ...

随机推荐

  1. JavaMail读取收件箱退信邮件/分析邮件附件获取Message_Id

    需求描述:公司最近有个项目邮件通知功能,但是客户上传的邮件地址并不一定存在,以及其他的各种问题.所有希望发送通知后有个回执,及时发现地址存在问题的邮箱. 需求分析:经过分析JavaMail可以读取收件 ...

  2. linux 上zookeeper安装

    一.zookeeper 的安装及配置 .Zookeeper下载 wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.3.6/zooke ...

  3. Date类与SimpleDateFormat类中parse()方法和format()方法

    package ppt11util类; import java.text.ParseException; import java.text.SimpleDateFormat; import java. ...

  4. 可用倍增LCA解题

    http://codevs.cn/problem/2370/ #include<bits/stdc++.h> using namespace std; ; ; struct node{ i ...

  5. Spring第一课:IOC控制反转,什么是反转,什么又是控制?

    前言 学习Spring第一课,就是认识IOC控制反转,要了解它还真得花一些功夫.今天主要理解透彻它的真谛,而不仅限于表面. 上道小菜 public class BusinessService { pr ...

  6. win10安装motionbuilder失败,怎么强力卸载删除注册表并重新安装

    一些搞设计的朋友在win10系统下安装motionbuilder失败或提示已安装,也有时候想重新安装motionbuilder的时候会出现本电脑windows系统已安装motionbuilder,你要 ...

  7. win10安装inventor失败,怎么强力卸载删除注册表并重新安装

    一些搞设计的朋友在win10系统下安装inventor失败或提示已安装,也有时候想重新安装inventor的时候会出现本电脑windows系统已安装inventor,你要是不留意直接安装invento ...

  8. 整合SSM遇到的错误,数据库连接失败问题集合

    Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be a ...

  9. html和jsp页面中把文本框禁用,只能读不能写的方法

    方法常用有三种: 第一种,使用   onfocus="this.blur()" <input name="deptno" type="text& ...

  10. <JZOJ5912>VanUSee

    挺魔的 反正我考场上想不到233333333333333 #include<cstdio> #include<cstring> #include<iostream> ...