
mybatis&Hibernate
「已注销」
这个作者很懒,什么都没留下…
展开
-
mybatis使用字符串参数
1. 参数为String时的插值问题假设有下面一Dao接口方法public Account findByAccountType (String type)throws DaoException; select * form account type=#{type} 一般我们都是按这样的方式来写的,对于其他类型是没错的,但是如果为String的话会抛下面的异常:There转载 2016-10-26 14:44:55 · 3684 阅读 · 0 评论 -
jpa使用oracle序列
原创 2017-03-25 08:22:37 · 1872 阅读 · 0 评论 -
mybatis基礎
select * from user where userName=#{userName} and password=#{password} select * from table_ip order by findTime desc limit ${offset}, ${size} select id, userName, password from use原创 2017-05-30 12:39:26 · 233 阅读 · 0 评论 -
mybatis关联查询
1、list属性,非关联n+1条sql2、list属性,一条sql关联查询3、mybatis关联查询4、mysql递归查询5、不返回list不可存在两条数据6、列表中包含对象查询7、使用注解注入多个参数原创 2017-05-30 12:51:14 · 307 阅读 · 0 评论 -
mybatis关联查询2
1、mybatis批量插入2、避免所有的值都为空时抛出异常3、多张表的延迟加载4、三张表一对多一对多的关联查询5、通过中间表多对多关系查询6、同时包含一对多和多对一的查询7、一对多的查询8、一对多延迟加载查询原创 2017-05-30 13:01:16 · 292 阅读 · 0 评论 -
mybatis缓存
1、mybatis一级缓存2、mybatis一级缓存集合3、缓存延迟加载配置4、缓存配置详解5、二级缓存配置6、是否清空二级缓存配置原创 2017-05-30 13:08:04 · 223 阅读 · 0 评论 -
logback打印mybatis sql语句
原创 2017-08-22 11:57:40 · 889 阅读 · 0 评论 -
mybatis参数设置
1、mybatis加#产生预编译sql,$非预编译sql。order by字段后无须使用预编译2、mybatis映射sql文件,paramtertype只有一个参数的,#{}取值,{}中的名字任意写。返回结果需要映射的,尽量使用resultmap,不需要的,如count查询记录数,返回integer等情况,再使用resulttype。转载 2017-03-14 15:45:32 · 449 阅读 · 0 评论