读书人

iBatis参数事例

发布时间: 2012-07-08 17:43:43 作者: rapoo

iBatis参数例子

?

原型参数

<select id="select1" parameterresultparameterresultparameterresultresultClass="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);

读书人网 >软件架构设计

热点推荐