iBATIS参数有哪些

这篇文章将为大家详细讲解有关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参数有哪些”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。


网站名称:iBATIS参数有哪些
分享网址:http://ybzwz.com/article/jiehji.html