ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edvin Syse <ed...@sysedata.no>
Subject IBATIS3: Is it possible to iterate over unnamed/single parameter?
Date Tue, 01 Dec 2009 08:42:48 GMT
I want to do a select where the parameter is a List<Integer>:

     <select id="byEntities" resultType="Location" resultMap="Location" parameterType="List">
         SELECT * FROM entity_location
         WHERE entity IN <foreach item="item" index="index" collection="list" open="("

separator="," close=")"> #{item} </foreach>

I don't have a domain object to hold my list of ints, so I'm trying to supply just the 
List<Integer> to the mapper method.

It seems that the collection="list" doesn't pick up the default parameter, like say #{ref}

would do. Is there a way to iterate over a non-named paramter, or do I need to wrap my 
list in another object to make this work?

Edvin Syse

To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org

View raw message