Mybatis
小诸葛的博客
毕业于广东石油化工学院,目前就职于金蝶国际软件集团,专注Java后端开发,个人微信公众号:小诸葛的博客。
展开
-
使用Mybatis时mysql数据库中不存在的字段如何标注
@TableField(exist = false) private String clusterId;原创 2022-03-25 14:37:27 · 1844 阅读 · 0 评论 -
MyBatis内置常用Java类型对应的别名
简述:为了方便开发,mybatis内置了常用的Java类型的别名,这样,我们开发时写查询结果返回的参数的resultType时就可以使用内置的别名。例如:如果要返回Map类型的结果,就不需要写java.util.Map,而只需要写map即可。mybatis内置别名:Alias Mapped Type _byte byte _long long _short...原创 2019-09-08 16:15:52 · 3119 阅读 · 2 评论 -
mybatis格式化查询出的日期
1.格式符说明%Y:年 示例:2019%m:月 示例:08%d:日 示例:05%H:时 示例:15%I:分 示例:47%S:秒 示例:562.使用示例DATE_FORMAT(NOW(),'%Y-%m-%d %H:%I:%S')...原创 2019-08-05 15:51:55 · 2975 阅读 · 0 评论 -
mybatis使用foreach查询
<select> <include refid="Base_Column_List" /> from router where management_id = #{managementId,jdbcType=INTEGER} and department_id = #{departmentId,jdbcType=INTEGER} and ...原创 2018-12-14 11:06:06 · 635 阅读 · 0 评论 -
Mybatis中判断集合的size
可以使用.size属性得到集合长度。 <if test="parkNums != null and parkNums.size > 0"> AND aa.park_num in( <foreach collection="parkNums" item="parkNum" index="index" separator=","&转载 2018-10-26 16:25:59 · 10928 阅读 · 0 评论 -
nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for proper
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'group_id' in 'class com.fangcun.group_assistant....原创 2018-10-23 15:24:57 · 7052 阅读 · 3 评论 -
mybatisGenerator生成代码时,只有insert方法
1.确保数据表有主键2.检查mybatis配置文件MBG.xml是否做了配置限制 <table tableName="push_code" domainObjectName="PushCode" enableCountByExample="false" enableUpdateByExample="false" enab...原创 2018-10-10 12:14:57 · 1741 阅读 · 0 评论 -
解决数据库查询时Null的问题(如SUM函数)
https://blog.csdn.net/qq844579582/article/details/52610484转载 2018-10-11 14:20:30 · 948 阅读 · 0 评论 -
【java】Mybatis返回int类型为空时报错 attempted to return null from a method with a primitive return type (int)
https://blog.csdn.net/kisscatforever/article/details/77801060转载 2018-09-17 18:25:54 · 1496 阅读 · 0 评论 -
IDEA使用Mybatis执行逆向工程
1.在pom文件中引入依赖<dependency> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-core</artifactId> <version>1.3.5</version></d...原创 2018-08-07 12:19:17 · 664 阅读 · 0 评论 -
Java MyBatis 插入数据库返回主键
https://www.cnblogs.com/xingyunblog/p/6243179.html转载 2018-08-11 11:55:41 · 211 阅读 · 0 评论 -
Idea mybatis maper接口与mapper.xml文件关联
原创 2018-08-14 10:35:44 · 4401 阅读 · 0 评论 -
org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'parkNum' in
mybatis查询报错: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'parkNum' in 'class java.lang.String'原因:参数错误解决方法:dao层做如下修改...原创 2018-08-10 17:09:10 · 179 阅读 · 0 评论 -
mybatis的mapper.xml文件中,数字无需做非空判断
如图,此时如果rolesId为零,则此if内的方法不会执行应该为如下:原创 2018-08-01 16:15:10 · 1615 阅读 · 0 评论 -
mybatis错误:Could not resolve resource location pattern [classpath:com/demon/user/mapper/*.xml]: class
ssm框架下mybatis报错:Could not resolve resource location pattern [classpath:com/demon/user/mapper/*.xml]: class path resource [com/demon/user/mapper/] cannot be resolved to URL because it does not exist这...转载 2018-07-30 20:14:00 · 3436 阅读 · 0 评论 -
MyBatis的Mapper接口以及Example的实例函数及详解
1.selectByExample()是一个可设置多个查询条件的查询方法,在此方法内部可设置多个与要查询的实体想匹配的条件 List<Book> listBook = new ArrayList<Book>(); BookExample example = new BookExample();//实例化一个example对象 BookExample.Criteri...原创 2018-06-04 19:06:53 · 481 阅读 · 0 评论 -
关于Mybatis的Example(and ,or )应用
https://www.cnblogs.com/FengLog/p/8464411.html转载 2018-06-11 10:58:08 · 2635 阅读 · 0 评论 -
MyBatis两张表字段名相同产生的问题
转自:https://blog.csdn.net/lee4037/article/details/16798941转载 2018-05-26 13:35:36 · 1816 阅读 · 0 评论 -
Mybatis从入门到精通(刘增辉)
http://yuedu.163.com/book_reader/df2407d3a666411e858417db3f4cef74_4原创 2018-05-13 15:43:57 · 4674 阅读 · 2 评论