ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Firas Adiler" <tapes...@idigna.com>
Subject RE: help problem with select request using 'in' where clause
Date Fri, 28 Jul 2006 11:10:46 GMT
Hi,

Two questions:

1) What's with the "where #DONNE_UUID# in ..."? Did you mean:
"where DONNE_UUID in ..."?

2) Are you sure iBatis understands this syntax: #[]# ? I've read somewhere
that it's not a valid syntax. In the "Developer's Guide" iBatis expect this
parameter to be "a property of type java.util.List that is to be iterated
over". You'd need some object/bean that returns these ids as a list, i.e:
List SomeObj.getIds(). In you xml code you'd refer to it as #ids[]#


Hope this helps,

</Firas>

-----Original Message-----
From: jeb001 [mailto:jeremy.jardin@gmail.com] 
Sent: Friday, July 28, 2006 9:21 AM
To: user-java@ibatis.apache.org
Subject: Re: help problem with select request using 'in' where clause


Hi,

Thanks for your help.. but something still drives me crazy..

It seems that I sould pass a "java.util.Map" object and not a
"java.util.List" in my select tag..
So, I did that :

// that list contains ids I want to add in 'in' clause.
List params = new ArrayList() ;

// I put it in a Map.       
Map par = new HashMap() ;
par.put("ids", params);
        try
        {
            cards = sqlMap.queryForList("DONNEE.selectFromDonneeUUID", par);

        }


My xmlFile :

   <select id="selectFromDonneeUUID"
resultMap="abatorgenerated_DonneeResult" parameterClass="java.util.Map">

    select DONNEE_UUID,
      DESCRIPTION,
      LIBELLE,
      TYPAGE,
      EVALUATEUR,
      TSTMPINSR,
      TSTMPUPDT
    from DONNEE
    where #DONNE_UUID# in 
    <iterate
      open=" ("
     close=")" conjunction="," property="ids">
      #[]#
    </iterate>
  </select>

But it doesn't work.. 

--
View this message in context:
http://www.nabble.com/help-problem-with-select-request-using-%27in%27-where-
clause-tf2009665.html#a5534831
Sent from the iBATIS - User - Java forum at Nabble.com.



Mime
View raw message