会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
myyismyy
博客园
首页
新随笔
联系
订阅
管理
2020年7月13日
PageHelper分页
摘要: 使用方法 1. 引入分页插件 引入分页插件有下面2种方式,推荐使用 Maven 方式。 1). 引入 Jar 包 你可以从下面的地址中下载最新版本的 jar 包 https://oss.sonatype.org/content/repositories/releases/com/github/pag
阅读全文
posted @ 2020-07-13 09:40 myyismyy
阅读(399)
评论(1)
推荐(0)
2020年7月12日
使用MyBatis实现批量操作
摘要: 批量操作DML //Connection - SqlSession操作Mybatis //conf.xml->reader Reader reader = Resources.getResourceAsReader("conf.xml"); //reader->sqlSession //可以通过bu
阅读全文
posted @ 2020-07-12 16:34 myyismyy
阅读(2854)
评论(0)
推荐(0)
2020年7月11日
自定义Mybatis拦截器和Plugin
摘要: 自定义插件: 四个处理:StatementHandler ParameterHandler ResultSethandler TypeHandler 四大核心对象:StatementHandler ParameterHandler ResultSethandler Executor 四大核心对象:1
阅读全文
posted @ 2020-07-11 16:29 myyismyy
阅读(384)
评论(0)
推荐(0)
MyBatis架构和源码分析
摘要: MyBatis架构和源码分析 MyBatis中步骤 a.获取SqlSessionFactory对象 b.获取Sqlsession对象 c.获取XxxMapper对象(代理接口中的方法、mapper.xml中的<select>等标签) d.执行<select>等标签中定义的SQL语句 a.获取SqlS
阅读全文
posted @ 2020-07-11 14:21 myyismyy
阅读(179)
评论(0)
推荐(0)
2020年7月9日
使用逆向工程进行快速开发
摘要: 逆向工程的使用 表(数据库)→实体类Student、StudentMapper.java、studentMapper.xml1.添加jar包 mybatis-3.5.1.jarmybatis-generator-core-1.3.5.jarojdbc7-12.1.0.2.jar 2.xml模板文件(
阅读全文
posted @ 2020-07-09 13:39 myyismyy
阅读(224)
评论(0)
推荐(0)
模糊查询三种解决方式
摘要: 模糊查询 1.${}:原样输出,不能防止sql注入 #{}:自动拼接引号 2.传值时,直接传 student.setStuName("%s%"); stuName like #{stuName} 3.bind参数 src\org\myy\mapper\studentMapper.xml 通过bind
阅读全文
posted @ 2020-07-09 10:46 myyismyy
阅读(1013)
评论(0)
推荐(0)
2020年7月8日
trim标签&&MyBatis内置参数
摘要: SQL标签:<trim> <where>可以处理拼接sql中 【开头】第一个and <trim>可以处理拼接sql中 【开头或结尾】第一个and 开头:给拼接的sql加prefix="where" suffixOverrides="and",处理拼接sql中开头第一个and <select id="
阅读全文
posted @ 2020-07-08 16:36 myyismyy
阅读(229)
评论(0)
推荐(0)
ResultMap&&鉴别器&&别名
摘要: ResultMap:字段和属性名的对应关系 修改数据库列名称 alter table student1 rename column stuno to sno; alter table student1 rename column stuname to sname; alter table stude
阅读全文
posted @ 2020-07-08 15:13 myyismyy
阅读(266)
评论(0)
推荐(0)
增加null&&使用HashMap存储查询结果集
摘要: 增加null oracle:如果插入的字段是Null,提示错误:Other而不是null mysql:如果插入的字段是Null,正常执行(没有约束) 原因:各个数据库在mybatis中对各种数据类型的默认值不一致 mybatis中,jdbcTypeForNull(如果是null),则默认值是Othe
阅读全文
posted @ 2020-07-08 13:55 myyismyy
阅读(306)
评论(0)
推荐(0)
2020年7月7日
MyBatis处理多个参数问题
摘要: 参数问题 目前将多个参数封装到一个javabean对象,然后使用该对象传递 a.传入多个参数时,不用再mapper.xml编写parameterType b.命名参数 src\org\myy\mapper\studentMapper.xml a. <insert id="addStudentmore
阅读全文
posted @ 2020-07-07 20:33 myyismyy
阅读(206)
评论(0)
推荐(0)
下一页
公告