You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Josh Joy <jo...@gmail.com> on 2008/06/19 05:29:53 UTC
ibatis decorater pattern
Hi,
I've seen and used the ability to have sql fragements, though is there a
sort of sql fragment decorater that I can do?
here is an quick simple example
<sql id="pagination">
select * from
(
select Row_Number(), !somesql!
) a
where RowNum > 1
</sql>
<select id="myquery">
<decorate refid="pagination">
select * from sometable
</decorate>
</select>
The alternative would be to split it into a header/footer and include for
each query, though would be convenient if there was some sort of decorater.
Thanks,
Josh