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 Michel Amaral <mi...@gmail.com> on 2007/08/27 19:15:07 UTC

Dynamic sql map with java.util.List

When I use parameterClass of java.util.List type with dynamic notation
($[].field$), the property (after dot) is ignored and the toString method of
the current list element is called instead of the indicated property, for
example, the follow statement map is calling toString twice:

<select id="<statement id>" remapResults="true" resultMap="<result map
name>"
parameterClass="java.util.List">
SELECT <cols>
FROM <clause>
 <dynamic prepend="WHERE">
  <iterate conjunction="AND">
   $[].field$ $[].operator$ #[].value#
   </iterate>
 </dynamic>
</select>

Re: Dynamic sql map with java.util.List

Posted by Brandon Goodin <br...@gmail.com>.
Since you are using 2.1.7 you will need to upgrade and try this with the
most current version. I believe this issue is fixed in the most current
version. I could be wrong. I made the same comment on the JIRA ticket. But,
I figured it would be worth repeating here.

Thanks,
Brandon

On 8/27/07, Michel Amaral <mi...@gmail.com> wrote:
>
> When I use parameterClass of java.util.List type with dynamic notation
> ($[].field$), the property (after dot) is ignored and the toString method of
> the current list element is called instead of the indicated property, for
> example, the follow statement map is calling toString twice:
>
> <select id="<statement id>" remapResults="true" resultMap="<result map
> name>"
> parameterClass="java.util.List">
> SELECT <cols>
> FROM <clause>
>  <dynamic prepend="WHERE">
>   <iterate conjunction="AND">
>    $[].field$ $[].operator$ #[].value#
>    </iterate>
>  </dynamic>
> </select>
>
>
>

Re: Dynamic sql map with java.util.List

Posted by Brandon Goodin <br...@gmail.com>.
Please open a JIRA ticket on this if it does not exist. In the meantime you
may want to pass your list in nested in a map.

Brandon

On 8/27/07, Michel Amaral <mi...@gmail.com> wrote:
>
> When I use parameterClass of java.util.List type with dynamic notation
> ($[].field$), the property (after dot) is ignored and the toString method of
> the current list element is called instead of the indicated property, for
> example, the follow statement map is calling toString twice:
>
> <select id="<statement id>" remapResults="true" resultMap="<result map
> name>"
> parameterClass="java.util.List">
> SELECT <cols>
> FROM <clause>
>  <dynamic prepend="WHERE">
>   <iterate conjunction="AND">
>    $[].field$ $[].operator$ #[].value#
>    </iterate>
>  </dynamic>
> </select>
>
>
>