1 @RequestMapping("/j3") 2 public String JsonDome3() throws JsonProcessingException { 3 ObjectMapper mapper = new ObjectMapper(); 4 Date date = new Da ...
分类:
其他好文 时间:
2020-04-13 00:57:07
阅读次数:
55
1)一级缓存: 基于 PerpetualCache 的 HashMap 本地缓存,其存储作用域为 Session,当 Session flush 或 close 之后,该 Session 中的所有 Cache 就 将清空,默认打开一级缓存。 2)二级缓存与一级缓存其机制相同,默认也是采用 Perpe ...
分类:
其他好文 时间:
2020-04-12 21:00:12
阅读次数:
91
第一种:接口实现类继承 SqlSessionDaoSupport:使用此种方法需要编写 mapper 接口,mapper 接口实现类、mapper.xml 文件。 1、在 sqlMapConfig.xml 中配置 mapper.xml 的位置 <mappers> <mapper resource=" ...
分类:
移动开发 时间:
2020-04-12 20:17:02
阅读次数:
175
<mapper namespace="com.lcb.mapping.userMapper"> <!--association 一对一关联查询 --> 第 43 页 共 485 页<select id="getClass" parameterType="int" resultMap="Classes ...
分类:
其他好文 时间:
2020-04-12 20:08:29
阅读次数:
107
新建一个config的包 把这两个类复制进来 默认初始化的数据库链接 数据的用户密码 这是驱动 **代表的是任意目录。也就是mettingfilm下任意目录找到dao,再找到mapper 复制到test目录下的generator目录下。因为和我们的业务没有关联。所以放在test下 官方提供的做了修改 ...
分类:
其他好文 时间:
2020-04-11 00:23:10
阅读次数:
72
1日志Mybatis通过使用内置的日志工厂提供日志功能。内置日志工厂将会把日志工作委托给下面的实现之一:SLF4JApacheCommonsLoggingLog4j2Log4jJDKloggingMyBatis内置日志工厂会基于运行时检测信息选择日志委托实现。它会(按上面罗列的顺序)使用第一个查找到的实现。当没有找到这些实现时,将会禁用日志功能。你可以通过在MyBatis配置文件mybatis-c
分类:
其他好文 时间:
2020-04-10 10:36:32
阅读次数:
85
spring boot 中使用mybatis 1.yml文件中读取xml配置文件 2.xml配置,使用mybatis的 mapper namespace对应上边定义的Dao 3.controller调用service service调用dao ...
分类:
其他好文 时间:
2020-04-10 00:06:36
阅读次数:
52
[TOC] 配置文件 InterceptorChain 拦截器集合 Configuration 配置文件中所有的属性都会封装到这个类里 Configuration构造器 注意,这里创建了一个用来存放mapper别名的typeAliasRegistry ,并且预置了好多别名进去。 TypeAliasR ...
分类:
其他好文 时间:
2020-04-09 21:34:34
阅读次数:
98
1.点击File >Settings >步骤如下图 模版内容: <?xml version="1.0" encoding="utf-8" ?><!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.or ...
分类:
移动开发 时间:
2020-04-08 20:51:46
阅读次数:
218
本次实践参考官方文档:mybatis-3.4.1.pdf。 2.1 Getting started public class MyBatisTest { /** * 1、接口式编程 * 原生: Dao > DaoImpl * mybatis: Mapper > xxMapper.xml * * 2、 ...
分类:
其他好文 时间:
2020-04-08 16:14:42
阅读次数:
54