随笔分类 -  ibatis

摘要:insert into user(userName,password,comment) values(#{userName},#{password},#{comment}) public class User { private int userId; private String userName; private String password; private ... 阅读全文
posted @ 2016-11-06 17:15 highfly2012 阅读(169) 评论(0) 推荐(0)
摘要:(1) 输入参数为单个值 Xml代码 deletefromMemberAccessLogwhereaccessTimestamp=#value#(2) 输入参数为一个对象Xml代码 insertintoMemberAccessLog(accessLogId,memberId,clientIP,httpMethod,actionId,requestURL,accessTimestamp,extend1,extend2,extend3)values(#accessLogId#,#memberId#,#clientIP#,#httpMethod#,#actionId#,#requestURL#,#a 阅读全文
posted @ 2013-07-21 14:24 highfly2012 阅读(215) 评论(0) 推荐(0)
摘要:在sql配置中比如in(#rewr#) 与in ($rewr$)在Ibatis中我们使用SqlMap进行Sql查询时需要引用参数,在参数引用中遇到的符号#和$之间的区分为,#可以进行与编译,进行类型匹配,而$不进行数据类型匹配,例如: select * from table where id = #id# ,其中如果字段id为字符型,那么#id#表示的就是'id'类型,如果id为整型,那么#id#就是id类型。 select * from table where id = $id$ ,如果字段id为整型,Sql语句就不会出错,但是如果字段id为字符型,那么Sql语句应该写成 s 阅读全文
posted @ 2013-07-21 14:07 highfly2012 阅读(197) 评论(0) 推荐(0)