上一页 1 ··· 3 4 5 6 7
摘要: 不同作用域和生命周期类别是至关重要的,因为错误的使用会导致非常严重的并发问题 SqlSessionFactoryBuilder 这个类可以被实例化、使用和丢弃,一旦创建了 SqlSessionFactory,就不再需要它了 作用域:方法作用域(局部作用域),写成静态代码块,在虚拟机初始化的时候执行, 阅读全文
posted @ 2020-07-23 10:00 Arno_vc 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 使用Map传递 优点:直接在sql中取出key即可 缺点:适用于小项目,不符合大公司规范 对象传递参数 优点:符合标准规范 缺点:麻烦 3.只有一个基本类型参数的情况下,直接在sql中取中 4.多个参数用Map,或者注解 阅读全文
posted @ 2020-07-22 20:36 Arno_vc 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 注:该文档参考了 https://mybatis.org/mybatis-3/zh/configuration.html 狂神的视频:https://www.bilibili.com/video/BV1NE411Q7Nx?p=17 ##一.配置属性(properties) 目标:解耦 直接在myba 阅读全文
posted @ 2020-07-22 20:33 Arno_vc 阅读(198) 评论(0) 推荐(0) 编辑
摘要: ##Mybatis环境配置 官方文档地址:https://mybatis.org/mybatis-3/zh/getting-started.html ###一.添加依赖 <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</ 阅读全文
posted @ 2020-07-21 19:59 Arno_vc 阅读(191) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7