You can set the comparison operator as
criteria.add("keywords", "%document%", Criteria.LIKE)
(You may have to cast one of the arguments).
There is a catchall Criteria.CUSTOM that allows you
to explicitely state your WHERE clause for complex
queries.
----- Original Message -----
From: Herv� Guidetti <[EMAIL PROTECTED]>
To: Turbine <[EMAIL PROTECTED]>
Sent: Monday, August 14, 2000 8:29 AM
Subject: Criteria : how to create complex query
> I've got some problems dealing with the Criteria class.
> I have to construct a Criteria to get a query like :
> select * from document where keywords like '%document%' and keywords not
> like '%first%' or keywords like '%apache%'
>
> How can I add the "like" in the where clauses of the criteria ?
> How can I add the OR in the where clause of the criteria ?
>
> Any idea ?
>
> Regards,
>
> Herv�
>
>
>
> ------------------------------------------------------------
> 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]