新聞中心
iBATIS參數(shù)的學(xué)習(xí),首先我們看看都有哪些iBATIS參數(shù):

◆iBATIS參數(shù)之:原型參數(shù)
- ﹤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參數(shù)之:Map類參數(shù)
- ﹤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參數(shù)之:對(duì)象參數(shù)
- ﹤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參數(shù) map.put("id", id);
AppLog log = (AppLog) sqlMapper.queryForObject("select0", map);
String參數(shù) AppLog log = (AppLog) sqlMapper.queryForObject("select0", id);
對(duì)象參數(shù) AppLog p=new AppLog();
p.setId(id);
AppLog log = (AppLog) sqlMapper.queryForObject("select0", p);
iBATIS參數(shù)的基本情況就介紹到這里,希望通過介紹使得你對(duì)iBATIS參數(shù)有一定的了解。
分享名稱:iBATIS參數(shù)理解淺析
URL分享:http://fisionsoft.com.cn/article/djjoiog.html


咨詢
建站咨詢
