The easy way is to add a CUSTOM criteria. The main problem with this is
that it requires a cast of one of the arguments. It can also be ugly to add
a CUSTOM criteria that involves several tables because you have to then add
some dummy criterias to get the additional tables.
How about adding a method to Criteria, addComplexCriteria(String[]
fromTables, String whereClause)? This method could hide these ugly details.
It should not be difficult.
John McNally
----- Original Message -----
From: Dan Diephouse <[EMAIL PROTECTED]>
To: Turbine <[EMAIL PROTECTED]>
Sent: Thursday, August 24, 2000 8:31 AM
Subject: Criteria problems
> I was looking at the Criteria class today to diagnose my problem. The
> class would not let me add multiple search criteria under a table and
> field name. For example, it is not possible to generate the clause:
>
> SELECT TABLE.* from TABLE WHERE TABLE.DESCR LIKE "%text%"
> AND TABLE.DESCR LIKE "%text2%";
>
> This is because the Criteria class associates the value to search for in
> a hash table with the table and fieldname. Is this behaviour
> desirable? Am I way off base here? It seems like it would require big
> changes to the code to change this behaviour. Comments on how this
> should work and what should happen?
>
> Thanks,
>
> Dan Diephouse
>
>
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?: [EMAIL PROTECTED]
>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]