I'm trying to do a query that would be something like the contains method of the interface
I have a class Collection
and I want to select the groups if your GrupoProdutos
, called Collection
, contains a certain product from another product list passed as a parameter.
I tried it like this and it did not work:
session.createCriteria(Grupo.class)
.createAlias("produtoCollection", "produto")
.add(Restrictions.in("produto", listaProdutos)).list();