I have a list of items. Each item has set of categories. I want to grab all the items of a specific category. This part is simple. The part I am having problems with is getting my query to return the item with all of its categories, not just the one I am filtering on.
session.createCriteria(Item.class) .createAlias("categories","category") .add(Restrictions.eq("category.name",categoryFilter))
The above code returns the item but only with the category I am filtering on. Is there anyway to say filter the object on this restriction, but return the full object and not the filtered one? I have also tried writing this in HQL with the same results.