ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Debasish Dutta Roy" <debasish.dutta...@gmail.com>
Subject Re: help problem with select request using 'in' where clause
Date Thu, 27 Jul 2006 14:09:45 GMT
   select DONNEE_UUID,DESCRIPTION,LIBELLE,TYPAGE,EVALUATEUR,TSTMPINSR,
TSTMPUPDT

    from DONNEE
        where
        <iterate open="DONNE_UUID IN(" close=")"
conjunction=",">#[]#</iterate>

Your select tag is as simple as
<select id="selectFromDonneeUUID" resultMap="abatorgenerated_DonneeResult">

>From your java code just send a list.

If you have other stuff in where clause then you need a dynamic around
iterate.

On 7/27/06, Rashmi Dixit <rashmid@gmail.com> wrote:
>
>  Hi Jeremy,
>
>
>
> I am afraid its not going to be so simple J
>
>
>
> You will need to iterate over the list yourself and append the commas. You
> need to look up the iterate tag in iBATIS. In case you have problems, shout,
> will give you more help.
>
>
>
> Regards
>
> ~Rashmi
>
>
>  ------------------------------
>
> *From:* jeremy jardin [mailto:jeremy.jardin@newtec.caisse-epargne.fr]
> *Sent:* Thursday, July 27, 2006 7:20 PM
> *To:* user-java@ibatis.apache.org
> *Subject:* help problem with select request using 'in' where clause
>
>
>
>
>
> Hi,
>
>
>
> I have to generate a request using 'in' where clause.
>
>
>
> The request I have to launch is like this :
>
> Select * from table where id in ('1', '2', '3');
>
>
>
> But I don't what kind of parameter I should add.
>
>
>
> This is my xml file :
>
>
>
>    <select id="selectFromDonneeUUID" resultMap="abatorgenerated_DonneeResult"
> parameterClass="java.util.List">
>
>     <!--
>
>       WARNING - This element is automatically generated by Abator for
> iBATIS, do not modify.
>
>       This element was generated on Wed Jul 12 09:28:22 CEST 2006.
>
>     -->
>
>     select DONNEE_UUID,
>
>       DESCRIPTION,
>
>       LIBELLE,
>
>       TYPAGE,
>
>       EVALUATEUR,
>
>       TSTMPINSR,
>
>       TSTMPUPDT
>
>     from DONNEE
>
>     where #DONNE_UUID# in (
>
>   </select>
>
>
>
> I've choosen to use "java.util.List" parameterClass but I don't really
> know what to use !
>
>
>
> Thx
>

Mime
View raw message