I am trying to migrate some reporting queries to Hibernate, and I am unable to find documentation anywhere that details how I might implement an OR clause using Criteria searches. For example, I am trying to do something roughly analogous to the following SQL:
select * from bid as b where b.amount < '100' or (b.amount > '100000' and b.date < '01-JAN-2004')
I apologize if this is in documentation or examples I have missed; every example I am able to find in the HIA object retrieval sections only uses straight AND criterias. I've searched the FAQ and the Criteria JavaDocs, but am still empty-handed. If I've overlooked something, or if there are resources that you can point me to, please let me know.
Todd Farmer
|