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: abator: dynamic where clause
Date Mon, 14 Aug 2006 18:25:42 GMT
There's no way to do this with Abator generated queries...yet...

Right now with Abator you can only do one LIKE clause in the dynamic where
clause.

With the next version of Abator you'll be able to do multiple LIKE clauses
or'd together in the dynamic where clause (you'll be able to generate
virtually unlimited dynamic where clauses).  Note that this support will
require that you upgrade to iBATIS 2.2.0.

When is the next version?  Soon!  iBATIS 2.2.0 should come out this week,
and Abator will follow quickly after that.

Jeff Butler


On 8/14/06, Thomas Karl Schwaerzler <Thomas.Schwaerzler@uibk.ac.at> wrote:
>
>
>
> hello again,
>
> i'd like to do something like the following,
> a 'dynamic where clause':
>
> public List<OdmCustomer> search( long groupId, String criterion,
> List<String> columns )
> {
>   String where = "";
>
>   while (existsNext)
>   {
>      column = (String) i.next();
>      where += column + " LIKE '%" + criterion + "%'";
>      if (existsNext = i.hasNext())
>         where += " OR ";
>
>   }
>
>   //...
>
>
>
> just using ibatis, it looks like this;
>
> <select id="search" parameterClass="string"
> resultMap="abatorgenerated_OdmCustomerResult">
>     select ID,
>       TITLE,
>       FIRST_NAME,
>       LAST_NAME,
>       STREET,
>       ZIP_CODE,
>       CITY,
>       COUNTRY,
>       PHONE_MOBILE,
>       PHONE,
>       FAX,
>       EMAIL,
>       GROUP_ID
>     from c108272dev.ODM_CUSTOMER
>     WHERE $value$
> </select>
>
> do i have to write my own sqlmap select entry like above for this or is
> there a way
> to do somthing like this with abator (e.g. with example?) ?
>
>
> thanks
> t.
>

Mime
View raw message