
Mybatis
小饼干_mum
这个作者很懒,什么都没留下…
展开
-
由浅入深分析mybatis通过动态代理实现拦截器(插件)的原理
转自:http://zhangbo-peipei-163-com.iteye.com/blog/2033832最近在用mybatis做项目,需要用到mybatis的拦截器功能,就顺便把mybatis的拦截器源码大致的看了一遍,为了温故而知新,在此就按照自己的理解由浅入深的理解一下它的设计。 和大家分享一下,不足和谬误之处欢迎交流。直接入正题。 首先,先不管mybatis的源码是转载 2017-07-22 15:58:52 · 241 阅读 · 0 评论 -
Mybatis+Mysql返回主键
使用MyBatis往MySQL数据库中插入一条记录后,成功则返回1,即成功的条数。如果要返回该条记录的自增主键值,在mapper中指定keyProperty属性,例如:(1) insert into user(userName,password,desc) values(#{userName},#{password},#{desc})(2)sele原创 2017-07-19 20:47:08 · 1950 阅读 · 0 评论 -
Mybatis把0识别为null
今天项目中定义了Integer type,把其默认值0传到mybatis。如果不空null并且不是空字符串才去修改这个值,但这样写只能针对字符串(String)类型,如果是Integer类型的话就会有问题了。where> if test="type != null and type !=''"> type=#{type} if>原创 2017-07-19 21:02:54 · 626 阅读 · 0 评论 -
Mysql字符串字段判断是否包含某个字符串的3种方法
转自:http://www.cnblogs.com/PatrickLiu/p/6369339.html方法一:SELECT * FROM users WHERE emails like "%b@email.com%";方法二:利用MySQL 字符串函数 find_in_set();SELECT * FROM users WHERE find_in_set('aa转载 2017-10-25 21:20:18 · 405 阅读 · 0 评论 -
mybatis-spring官方中文教程文档
一、mybatis-spring二、配置文件 classpath*:mapper/**/*Mapper.xml 三、MapperScannerConfigurerMyBat原创 2017-11-02 21:11:14 · 926 阅读 · 0 评论 -
Could not find method on interface org.apache.ibatis.executor.statement.StatementHandler
转自:https://www.cnblogs.com/EasonJim/p/7056700.htmlMyBatis3.4.0以上的分页插件错误:Could not find method on interface org.apache.ibatis.executor.statement.StatementHandler named prepare. Cause: java.lang转载 2017-11-21 21:11:32 · 5489 阅读 · 0 评论