ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Writing Dyamic Query
Date Thu, 08 Mar 2007 16:14:58 GMT
How about this...

List<Integer> list = new ArrayList<Integer>();
list.add(1);
list.add(2);
SomeTableExample example = new SomeTableExample();
example.createCriteria().andIdNotIn(list);
List<SomeTable> records = selectByExample(example);

Jeff Butler


On 3/8/07, Kulbhushan, Singh (IE10) <Kulbhushan.Singh@honeywell.com> wrote:
>
>  Table  : TABLE
>
> ID
>
> NAME
>
> ADDRESS
>
> 1
>
> A
>
> A1
>
> 2
>
> B
>
> B1
>
> 3
>
> C
>
> C1
>
> 4
>
> D
>
> D1
>
> 5
>
> E
>
> D2
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I have a arrayList containing the  ID's to filter.
>
>
>
> I have to execute SELECT ID,NAME,ADRESS FROM TABLE WHERE ID <>1 AND ID<>2
> …. (Dynamic)
>
> What I need to do in ABATOR generated code.
>
>
>
> Thanks for Help
>
> Kulbhushan
>

Mime
View raw message