Hi, i have a followed many to many (example) association:
---------------- --------------------------- ---------------------- | ITEM | | ITEM_CATEGORY | | CATEGORY | ---------------- -------------------------- ---------------------- | item nb. 1 | | item nb.1 / cat nb.1 | | category nb. 1 | ---------------- -------------------------- ----------------------- | item nb. 2 | | item nb.1 / cat nb. 2 | | category nb. 2 | ---------------- --------------------------- ---------------------- | item nb. 3 | ............. ----------------
I wont retrive items which belong do category nb.1 AND category nb.2
If i have criteria:
Criteria crit = sess.createCriteria(ITEM.class); crit.createAlias("categories", "cat");
so i have above drawn situation.
If item have to belong to cat1 or cat2 everyting is easy: i use Disjunction But in my situation i can't use Conjunction (or a few restrctions) beacouse this is not what I mean
Thank for any tips
|