ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jakub Scheibe" <jakub.sche...@gmail.com>
Subject Re: Dynamic ResultMaps
Date Tue, 28 Nov 2006 11:24:19 GMT
When I'm using my class as a resultclass i'm only getting
null values :(

On 28/11/06, Nikhil Vaghela <nikhil.vaghela@in.v2solutions.com> wrote:
>
>  Hi ,
>
>
>
> In such situation you can use resultClass instead of resultMap , and in
> that case you should have your property [in your custom objects] names same
> as your query's fields name.
>
>
>
> Nikhil.
>  ------------------------------
>
> *From:* Jakub Scheibe [mailto:jakub.scheibe@gmail.com]
> *Sent:* Tuesday, November 28, 2006 4:42 PM
> *To:* user-cs@ibatis.apache.org
> *Subject:* Dynamic ResultMaps
>
>
>
> Hi,
>
> Is there any way to create dynamic resultmaps?
> In this moment i'm preparing dynamic sql statement but I don't know how to
> prepare dynamic resultmap
>
> Here is how i'm doing this:
>
>         <select id="Select" parameterclass="MyClass" resultmap="MyResMap">
>
>             select
>             <dynamic>
>                 <isEqual property="Id" compareValue="1">
>                     ID
>                 </isEqual>
>                 <isEqual property="Name" compareValue="true" prepend=",">
>                     NAME
>                 </isEqual>
>             </dynamic>
>             from MYTBL
>         </select>
>
> if I use following resultmap it working ok but i need to use both Id and
> Name in Select
>
>         <resultMap id="MyResMap">
>                 <result property="Id" column="ID"/>
>                 <result property="Name" column="Name"/>
>         </resultMap>
>
> Regards,
> Jakub
>

Mime
View raw message