db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: Searching in Arrays
Date Wed, 08 Jun 2005 17:03:45 GMT




Hi,

I would guess this is not a feature supported natively by Torque.
I would try two things

1)
Criteria criteria = new Criteria();
criteria.add(SalEmpPeer.PAY_BY_QUARTER + "[1]", 10000);
criteria.add(SalEmpPeer.PAY_BY_QUARTER + "[2]", 1000);
...
SalEmpPeer.doSelect(criteria);

This may fail because Torque might try to add pay_by_quarter[1]... to the
list of columns to select from.

2)
It might work with criteria.custom using "[1]=", "[2]=".... as operators.
Probably your column names are equal then, so you probably have to use
Criterions and the constructor

Criterion(String table, String column, Object val, SqlEnum comp)

Please mail us the results.

    Thomas

"Ferruh Zamangoer" <ferruh.zamangoer@gmx.de> schrieb am 08.06.2005
17:10:30:

> Hi,
>
>
>
> we want to use Torque with a PostgresSQL Database does Torque support
> searching in arrays? On the postgresSQL website I see that postgres
supports
> it. The search query is below:
>
>
>
> SELECT * FROM sal_emp WHERE pay_by_quarter[1] = 10000 AND
>
>                             pay_by_quarter[2] = 1000 AND
>
>                             pay_by_quarter[3] = 1000 AND
>
>                             pay_by_quarter[4] = 1000;
>
>
>
> Thanks for any help in advance.
>
> Regards
>
> Ferruh
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message