随笔分类 - mybatis
摘要:前言-Mybatis整合第三方缓存原理图: 解读: 客户从数据库获取数据视为一次会话,抽象为sqlSession对象 一个Excutor包含增删改查的操作; CachingExcutor是对Excutor的包装,此处相当于代理模式 当有会话时,先访问CachingExcutor对象,CachingE
阅读全文
摘要:1、在mybatis-config.xml开启二级缓存配置(默认开启的); 2、二级缓存是namespace级别的(在mapper里添加); 其他mapper也使用该二级缓存配置 <cache-ref namespace="com.someone.application.data.SomeMappe
阅读全文
摘要://通过配置文件取到sqlSessionFactory String resource = "mybatis-config.xml"; InputStream inputStream = null; try { inputStream = Resources.getResourceAsStream(
阅读全文

浙公网安备 33010602011771号