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参数的基本情况就介绍到这里,希望通过介绍使得你对iBATIS参数有一定的了解。
网页标题:iBATIS参数理解浅析
URL链接:http://www.shufengxianlan.com/qtweb/news37/436737.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联