码迷,mamicode.com
首页 >  
搜索关键字:parametertype    ( 388个结果
mybatis <where>、<set>、<trim>、<sql>、<foreach>标签的使用
mybatis where标签的使用 where后面跟查询条件 简化sql语句中判断条件的书写 例: <select id="user" parameterType="user" resultType="User"> select * from user <where> <if test="id!= ...
分类:数据库   时间:2016-08-12 23:45:26    阅读次数:334
mybatis动态sql中where标签的使用
where标记的作用类似于动态sql中的set标记,他的作用主要是用来简化sql语句中where条件判断的书写的,如下所示: <select id="selectByParams" parameterType="map" resultType="user"> select * from user < ...
分类:数据库   时间:2016-08-11 20:59:44    阅读次数:1436
mybatis动态SQL中的sql片段
在mybatis中通过使用SQL片段可以提高代码的重用性,如下情景: 1、创建动态SQL <sql id="sql_count">select count(*)</sql> 2、使用 <select id="selectListCountByParam" parameterType="map" re ...
分类:数据库   时间:2016-08-11 20:39:36    阅读次数:198
org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'parentId' in 'class java.lang.String'
sql: 解决方法: 将参数名(上面的例子为’parentId’)替换为”_parameter” As documented, parameterType is optional and it is usually better to let MyBatis detect it. As your s ...
分类:编程语言   时间:2016-08-09 20:41:57    阅读次数:283
mybatis 简单实现 left join
sql xml 内部调用不需要在mapper接口中定义(getTbNameById 只写到mapper.xml 中即可) 注:resultType or resultMap 和 association的property类型保持一致。 association 传多个参数 parameterType=" ...
分类:其他好文   时间:2016-08-06 08:20:23    阅读次数:1075
记录一次bug解决过程:规范变量名称和mybatis的使用以及代码优化
一、总结 二、Bug描述:Mybatis中parameterType使用 mapper层中使用parameterType="java.lang.Integer"基本类型,代码报错: 解决办法,当入参为基本数据类型的使用,使用_parameter代替基本数据类型,如下: 或者在mapper层的接口中, ...
分类:其他好文   时间:2016-08-05 22:48:42    阅读次数:361
MyBatis的动态SQL详解
<update id="updateUserSet" parameterType="User"> update User <set> <if test="userName != null">userName=#{userName},</if> <if test="password != null"> ...
分类:数据库   时间:2016-08-05 13:55:49    阅读次数:271
查询条件左边写入函数,导致无法命中索引
背景: 简单罗列下之前做过的优化,人懒。 所以没能把所有的整理统一放出来。 情况: 系统查询过慢,没能命中索引。 <!--对账单数量 --> <select id="selectCount" resultType="java.lang.Integer" parameterType="map"> se ...
分类:其他好文   时间:2016-08-02 22:17:32    阅读次数:652
映射语句之INSERT语句
1.一个 INSERT SQL 语句可以在<insert>元素在映射器 XML 配置文件中配置 例子: <insert id="insertStudentWithId" parameterType="Student"> INSERT INTO Student(id,name,sex,birthday ...
分类:其他好文   时间:2016-08-02 13:16:46    阅读次数:116
MyBatis之传入参数
在MyBatis的select、insert、update、delete这些元素中都提到了parameterType这个属性。MyBatis现在可以使用的parameterType有基本数据类型和JAVA复杂数据类型 基本数据类型:包含int,String,Date等。基本数据类型作为传参,只能传入 ...
分类:其他好文   时间:2016-08-01 19:32:23    阅读次数:147
388条   上一页 1 ... 28 29 30 31 32 ... 39 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!