I have a data model that looks something like this:
public class Item {
private List attributes;
// other stuff
}
public class Item
I didn't test it, but this is how I should try to solve your problem if I would have to:
Map map1 = new TreeMap();
map1.put("ia.name","foo1");
map1.put("ia.value","bar1");
Map map2 = new TreeMap();
map2.put("ia.name","foo2");
map2.put("ia.value","bar2");
return getSession().createCriteria(Item.class)
.createAlias("itemAttributes", "ia")
.add(Restrictions.and()
.add(Restrictions.allEq(map1))
.add(Restrictions.allEq(map2))
)
.list();
Please, let me know if it worked. I think the same should work with or()...