I am not sure how to make a disjunction on a criteria's associations.
I know how to filter people based on their associations (e.g. "clubs" or "hobbies")
Code:
//this is, effectively, an "and" search
//search for people...
Criteria pCrit = sess.createCriteria(Person.class);
//further filter on both club or hobbies
pCrit.createCriteria("clubs");
pCrit.createCriteria("hobbies");
But what if I wanted to search on
either club or hobbies?
Code:
//I can create a disjunction, and add it to the root people criteria..
Junction dJunc = Expression.disjunction();
pCrit.add( dJunc );
//but how do I add the Person class's associated critera to a disjunction?
Thanks for any help. I think I am missing something here.