Quantcast

Referring to a parameter object

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Referring to a parameter object

AndyK
I'm porting some ibatis extension code to mybatis. In that code we
generate an isParameterPresent block. What is the equivalent in
mybatis?

For example,

<select id="specialSelect" parameterType="ComplexObject"
resultType="AnotherObject" >
    <include refid="anotherSelect" />
    from A_TABLE
    <isParameterPresent >
      <isNotNull property="aProperty" >
        order by #{aProperty}
      </isNotNull>
    </isParameterPresent>
  </select>

How would I convert that to <if test="X != null"> ? I don't know what
the value of X should be - i.e. how do I refer to ComplexObject itself
and not a property of ComplexObject?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Referring to a parameter object

Jeff Butler
<if test="_parameter != null">
</if>

I'm not sure this ever made it into the docs.

Jeff Butler


On Tue, Jun 21, 2011 at 4:01 PM, AndyK <[hidden email]> wrote:

> I'm porting some ibatis extension code to mybatis. In that code we
> generate an isParameterPresent block. What is the equivalent in
> mybatis?
>
> For example,
>
> <select id="specialSelect" parameterType="ComplexObject"
> resultType="AnotherObject" >
>    <include refid="anotherSelect" />
>    from A_TABLE
>    <isParameterPresent >
>      <isNotNull property="aProperty" >
>        order by #{aProperty}
>      </isNotNull>
>    </isParameterPresent>
>  </select>
>
> How would I convert that to <if test="X != null"> ? I don't know what
> the value of X should be - i.e. how do I refer to ComplexObject itself
> and not a property of ComplexObject?
Loading...