iBATIS参数有哪些

发布时间:2021-12-03 09:54:28 作者:小新
来源:亿速云 阅读:122

这篇文章将为大家详细讲解有关iBATIS参数有哪些,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

iBATIS参数的学习,首先我们看看都有哪些iBATIS参数:

◆iBATIS参数之:原型参数

﹤select id="select1" parameterClass="java.lang.String" resultClass="AppLog"﹥  select  ID as id,  TYPE as type,  DESCR as descr  from APP_LOG  where ID = #id#  ﹤/select﹥

sqlMapper.queryForObject("select0", id);

◆iBATIS参数之:Map类参数

﹤select id="select2" parameterClass="java.util.HashMap" resultClass="AppLog"﹥  select  ID as id,  TYPE as type,  DESCR as descr  from APP_LOG  where ID = #id#  ﹤/select﹥

map.put("id", id);

AppLog log = (AppLog) sqlMapper.queryForObject("select0", map);

◆iBATIS参数之:对象参数

﹤select id="select3" parameterClass="AppLog" resultClass="AppLog"﹥  select  ID as id,  TYPE as type,  DESCR as descr  from APP_LOG  where ID = #id#  ﹤/select﹥

AppLog p=new AppLog();
p.setId(id);
AppLog log = (AppLog) sqlMapper.queryForObject("select3", p);

﹤select id="select0" resultClass="AppLog"﹥  select  ID as id,  TYPE as type,  DESCR as descr  from APP_LOG  where ID = #id#  ﹤/select﹥

Map参数  map.put("id", id);

AppLog log = (AppLog) sqlMapper.queryForObject("select0", map);

String参数  AppLog log = (AppLog) sqlMapper.queryForObject("select0", id);

对象参数  AppLog p=new AppLog();

p.setId(id);

AppLog log = (AppLog) sqlMapper.queryForObject("select0", p);

关于“iBATIS参数有哪些”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

推荐阅读:
  1. 选用Ibatis和Hibernate有哪些区别
  2. Hibernate ibatis怎么理解

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

ibatis

上一篇:C#的贪婪与非贪婪怎么理解

下一篇:tk.Mybatis插入数据获取Id怎么实现

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》