ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Henrique Ferreira e Silva <dhsi...@gmail.com>
Subject Re: HashMap and SELECT WHERE IN
Date Thu, 14 Jul 2005 13:42:57 GMT
Hi Honda,

I think the best and simple approach you can take in this situation is
using a List instead of a HashMap (sorry Vic :).

Having a list would allow you to do something like this:

<select id="yourselectId" parameterClass="list" resultMap="map">
  SELECT
    *
  FROM
    table
  <dynamic prepend="WHERE">
      <iterate
        open=" id IN ("
       close=")" conjunction=",">
        #[]#
      </iterate>
  </dynamic>
 </select>


Cheers,
Daniel Silva.

On 7/14/05, Hond4 <hond4@gazeta.pl> wrote:
> Hallo list users!
> 
> i have one HashMap with ID's. is it possible to create one SQL query
> 
> SELECT * FROM table WHERE id IN (1,2,3,4) ?
> 
> where can i find some examples of iterate tag ?
> 
> Best regards,
> H0nd4
> 
> 
>

Mime
View raw message