2017年10月17日

深入了解MyBatis参数

摘要: 相信很多人可能都遇到过下面这些异常: "Parameter 'xxx' not found. Available parameters are [...]" "Could not get property 'xxx' from xxxClass. Cause: "The expression 'xx 阅读全文

posted @ 2017-10-17 16:47 释迦&牟尼 阅读(405) 评论(0) 推荐(0)

mybatis中_parameter使用和常用sql

摘要: 1. 简单数据类型,此时#{id,jdbcType=INTEGER}中id可以取任意名字如#{a,jdbcType=INTEGER},如果需要if test则一定 使用<if test="_parameter != null">,此处一定使用_parameter != null而不是id != nu 阅读全文

posted @ 2017-10-17 16:31 释迦&牟尼 阅读(9374) 评论(0) 推荐(0)

ibatis中井号跟美元符号区别(#.$)

摘要: 1、#可以进行预编译,进行类型匹配,#变量名# 会转化为 jdbc 的 类型 $不进行数据类型匹配,$变量名$就直接把 $name$替换为 name的内容 例如: select * from tablename where id = #id# ,假设id的值为12,其中如果数据库字段id为字符型,那 阅读全文

posted @ 2017-10-17 16:20 释迦&牟尼 阅读(1370) 评论(0) 推荐(0)

mybatis动态sql中的trim标签的使用

摘要: trim标记是一个格式化的标记,可以完成set或者是where标记的功能,如下代码: 1、 select * from user <trim prefix="WHERE" prefixoverride="AND |OR"> <if test="name != null and name.length 阅读全文

posted @ 2017-10-17 16:18 释迦&牟尼 阅读(567) 评论(0) 推荐(0)

导航