2
I’m trying to make a query that would be something like the method contains of interface Collection
java.
I have a class GrupoProdutos
and want to select the groups if your Collection
, calling for produtoCollection
, contains a particular product from another product list passed as a parameter.
I tried it like this and it didn’t work:
session.createCriteria(Grupo.class)
.createAlias("produtoCollection", "produto")
.add(Restrictions.in("produto", listaProdutos)).list();
The product is a Collection item or an item attribute?
– Dener
From what I understand, you want to know if product Ollection (is a Collection right?) contains any item from a list passed as parameter?
– Dener
Hello Dener, that’s right, I want to know if productCollection contains any product from the listProducts that was passed as parameter.
– Resende