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 Sat, 10 Mar 2007 13:18:44 GMT
No - the legacy generator set can't do what you want.  You'd need to hand
code a select.

The Java2 set will work - you just lose the generices, but everything else
is the same.  I'd really recommend you move to the Java2 generator set - the
generated code is far superior.  The only thing is that you need to use
iBATIS 2.2 or later with the Java2 or Java5 sets.

In the next release of Abator, the Java2 set will be the default.

Jeff Butler


On 3/9/07, Kulbhushan, Singh (IE10) <Kulbhushan.Singh@honeywell.com> wrote:
>
>  Thanks Jeff,
>
>
>
> Actually we are using generatorSet="Legacy". We would change that to Java2
> generatorSet because we are using java 1.4. Any other way to achieve the
> same with Legacy generatorSet?
>
>
>
> Regards
>
> Kulbhushan
>
>
>  ------------------------------
>
> *From:* Jeff Butler [mailto:jeffgbutler@gmail.com]
> *Sent:* Thursday, March 08, 2007 9:45 PM
> *To:* user-java@ibatis.apache.org
> *Subject:* Re: Writing Dyamic Query
>
>
>
> 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