掃二維碼與項(xiàng)目經(jīng)理溝通
我們在微信上24小時(shí)期待你的聲音
解答本文疑問/技術(shù)咨詢/運(yùn)營咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流
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ù)有一定的了解。

我們在微信上24小時(shí)期待你的聲音
解答本文疑問/技術(shù)咨詢/運(yùn)營咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流