Hi Tino,
You can override Ereignis.toString() method to make it return a valid String for a query and then freely use it in Criterias.
E.g. Ereignis.toString() will return something like "1000" (ID of an object in the database).
A List.toString() will call toString() of each Ereignis objects and return something like this "1000, 1001".
Then your where clause will be "WHERE ID IN (1000, 1001)"
This is a valid SQL and you can write in your code criteria.addNotIn(ereignisList);


Regards,
Kostya

So you used the BaseBeer instead of a generated peer
like EreignisPeer.doSelect(), because the latter would return Objects of "Ereignis", and Ereignis.toString() also doesn't give an ID-String when submitted to criteria.addNotIn(), right?!


Best Regards,

Tino

-----Urspr�ngliche Nachricht-----
Von: Chris Joelly [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 2. M�rz 2004 10:19
An: Apache Torque Users List
Betreff: Re: Torque, building Criteria for query ...


Hello!


yep. my problem was the surrounding {} ...

thx, Chris

Am Tue, Mar 02, 2004 at 09:37:41AM +0100, Kostyantyn Shchekotykhin meinte:

with this method all is ok, the problem was that Chris wanted to add dicertly a List with Records and not Integers. When BasePeer composes query each Criterion value is converted to String. Village's Record.toString() is implemented so that each Record field is surrounded with {}. E.g. if it contains an Integer it will be something like "WHERE ID = {1000}".

Sperlich, Tino wrote:

you have probably fixed the problem; but just for my info:
in the API of criteria there is a method like this

public Criteria addNotIn(java.lang.String column,
                       java.util.List values)

is there something wrong with this or would that do the job, too?



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to