Does IBATIS.NET supports reuse SQL-fragment such as
this
http://opensource2.atlassian.com/confluence/oss/pages/viewpage.action?pageId=707
This is useful for situation where I have the multiple
select statements in one mapping file. For example, I
have something like this
<select id="GetApplication"
resultMap="ApplicationResult" parameterClass="int">
SELECT
Application_Id,
Application_Name,
Application_Description
FROM
tb_Application
WHERE
Application_Id = #value#
</select>
<select id="GetApplicationByName"
resultMap="ApplicationResult" parameterClass="string">
SELECT
Application_Id,
Application_Name,
Application_Description
FROM
tb_Application
WHERE
Application_Name = #value#
</select>
and I would like it to be like this
<sql id="selectApplication_fragment">
SELECT
Application_Id,
Application_Name,
Application_Description
FROM
tb_Application
</sql>
<select id="GetApplication"
resultMap="ApplicationResult" parameterClass="int">
<include refid="selectApplication_fragment"/>
WHERE
Application_Id = #value#
</select>
<select id="GetApplicationByName"
resultMap="ApplicationResult" parameterClass="string">
<include refid="selectApplication_fragment"/>
WHERE
Application_Name = #value#
</select>
Can you show me if there is a better way.
Thanks,
Hai
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com