ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <lmead...@apache.org>
Subject Re: Using <dynamic> elements
Date Thu, 26 Jan 2006 16:37:36 GMT
Why would you do that?

That makes no sense at all in a parameter map - we have the dynamic
sql so you can choose how to apply the parameters in the statement.

You can also use dyanmic sql in the select list, with a
remapResults="true", and change the returned columns.

Larry


On 1/26/06, Rick Gray <rgray1955@yahoo.com> wrote:
> Mark, I need to know if i can build dynamic result maps and dynamic
> parameter maps using the <dynamic> element like you can in the statement.
> In other words can i use the <dynamic>, <IsNotNull> and other dynamic
> elements in the result and parameter maps? The section of code below was
> taken from the dynamic statement example in the manual.
>
>
> <dynamic prepend="WHERE">
> <isNotNull prepend="AND" property="firstName">
> (ACC_FIRST_NAME = #firstName#
> <isNotNull prepend="OR" property="lastName">
> ACC_LAST_NAME = #lastName#
> </isNotNull>
> )
> </isNotNull>
> <isNotNull prepend="AND" property="emailAddress">
> ACC_EMAIL like #emailAddress#
> </isNotNull>
> <isGreaterThan prepend="AND" property="id" compareValue="0">
> ACC_ID = #id#
> </isGreaterThan>
> </dynamic>
>
>
>
> Mark Bennett <mark.bennett.mail@gmail.com> wrote:
> You can extend resultmaps which allow you to factor similar fields but allow
> special handling for separate fields.
>
> <resultMap id="myResult" extends="BaseMap" class="myClass">
>         <result property="special" column="specialCol" select="
> Namespace.getFromSomeWhere"/>
> </resultMap>
>
> Mark
>
>
>
> On 1/25/06, Rick Gray <rgray1955@yahoo.com > wrote:
>
> Hi,
>
> I'm evaluating IBATIS for use in our project. I need to know if I can use
> <dynamic> elements in the ParameterMaps and ResultMaps. I want to keep the
> parameters and results in sync with the statement.
>
> Thanks
>
> Rick
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com

Mime
View raw message