ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stief Dirckx <Stief.Dir...@icasa-consulting.com>
Subject dynamic order by clause
Date Mon, 21 Aug 2006 06:45:14 GMT
Hi

I'm having some questions about the dynamic sorting example in the iBatis 
datamapper manual on page 51. What I want to do is is to pass an object to 
an select statement but I also want to make the sorting dynamic (sort 
field and sort type). But how can I pass these 2 extra parameters using 
the QueryForList method?

This is what I have up to now:
<select id="SelectUser" parameterClass="User" resultMap="UserResult">
    ...
    <dynamic prepend="ORDER BY ">
        <isNotEmpty property="SortField">
            ORDER BY $SortField$ $SortType$
        </isNotEmpty>
    </dynamic>
</select>
But with this solution I have to add 2 properties to my user class 
(sortfield and sorttype). How can I avoid doing that?

Stief.

Mime
View raw message