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. Pandas Series 对象的loc与iloc区别

    import pandas as pd temp = pd.Series([,,,,]) loc用法: temp.loc[:] 0 1 1 2 2 3 3 4 # 输出索引为0-3的值(基于索引) t ...

  2. Graylog

    Graylog #Graylog 是与 ELK 可以相提并论的一款集中式日志管理方案,支持数据收集.检索.可视化 ​#Graylog 架构 - Graylog 负责接收来自各种设备和应用的日志,并为用 ...

  3. LeetCode No.91,92,93

    No.91 NumDecodings 解码方法 题目 一条包含字母 A-Z 的消息通过以下方式进行了编码: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 给定一个只 ...

  4. Python语言学习前提:python安装和pycharm安装

    一.Windows系统python安装 1.python官网:https://www.python.org/downloads/ 2.官网首页:点击Downloads > Windows > ...

  5. python学习笔记(18)字典和json 的区别 和转换

    字典和json 的区别 和转换 前言:字典和json非常像.接下来比较一下两者的异同 先看一下字典的写法: a = {'a':'1', 'b':'2', 'c':'3' } 再看一下json的写法: ...

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

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

  7. 数论入门——斐蜀定理与拓展欧几里得算法

    斐蜀定理 内容 斐蜀定理又叫贝祖定理,它的内容是这样的: 若$a,bin N$,那么对于任意x,y,方程$ax+by=gcd(a,b)*k(kin N)$一定有解,且一定有一组解使$ax+by=gcd ...

  8. Redis为什么这么快以及持久化机制

    1.首先我们谈一下为什么Redis快: 一. Redis是纯内存数据库,一般都是简单的存取操作,线程占用的时间很多,时间的花费主要集中在IO上,所以读取速度快. 二. 再说一下IO,Redis使用的是 ...

  9. [LC] 156. Binary Tree Upside Down

    Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that ...

  10. 安装python第三方包

    20190822 先说一下,有4种方法(我知道的): 1.源码安装 2.python自带包管理器安装 3.外部包管理器安装 4.whl格式安装 1.源码安装 Python第三方库几乎都可以在githu ...