I am pretty new to hibernate and am having trouble working this out.
I want to query for an entity where that entity has multiple associations which I want to specify as the criteria. These associated entities are not necessarily exhaustive. IE. It may have more but as long as it has those specified return it.
Eg.
* from order where order has item 1 and order has item 2
I have tried using the criteria API by first creating a criteria on order, then an association criteria on item and adding both item example objects to the item criteria - No results.
If I add just 1 example item, it does return a result. I know about the disjunctions and conjunctions, but can't figure where they might fit in. Any suggestions please?
|