mybatis
文章平均质量分 80
淘技术
专注于分享最前沿的技术干货,最热门的实用工具,最火爆的社区新闻!
展开
-
mybatis一對一关系保存
1.创建两个实体类,classes和teacherpackage com.sq.entity;public class Classes { private Integer id; private String name; private Teacher teacher; public Integer getId() { return id; } public void原创 2017-08-23 10:42:58 · 1164 阅读 · 0 评论 -
mybatis动态sql使用
1.if(用于判断条件,如果成了则执行相关语句)select id="dynamicIfTest" resultType="User"> select * from user where sex = 'male' and address = #{address} 2.choose(相当于java中的switch,一旦有条件满足就会跳出)原创 2017-08-23 14:15:32 · 246 阅读 · 0 评论 -
Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for com
1.没有找到seckill的resultMap2.解决:在mapper文件中加入 错误就会解决原创 2017-08-30 10:08:38 · 5847 阅读 · 0 评论 -
Parameter 'offset' not found. Available parameters are [arg1, arg0, param1, param2]
在Dao层的接口需要传递多个参数,在参数前加上@Param("offset")原创 2017-08-30 10:20:08 · 2489 阅读 · 0 评论 -
mybatis去除多余的and或者or
<select id="selectBySelective" resultType="xxx.UserInfo">select<include refid="Base_Column_List" />from uc_user<trim prefix="WHERE (" suffix=")" prefixOverrid转载 2018-09-04 11:53:47 · 17533 阅读 · 1 评论