Hello,
Having an entity Items that have a collection field called labels, I need to find items that have two specific labels.
@Entity public class Items { private List<Label> labels; }
I can find an item that have one label:
SELECT i FROM Item i WHERE :label MEMBER OF item.labels
I can select items with any of several labels:
SELECT i FROM Item i WHERE :label1 MEMBER OF item.labels OR :label2 MEMBER OF item.labels
But when I search for an item that have two specific labels, the following query gets no items:
SELECT i FROM Item i WHERE :label1 MEMBER OF item.labels AND :label2 MEMBER OF item.labels
Is it a bug or JPQL query is wrong?
Best regards,
Pablo.