随笔分类 -  mybatis

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