Selecting an entity by collection set equality
问题 I'm trying to do a JPQL query or JPA operation that does the following. I have an element, that consist of an element collection of Strings: @Entity(name="REQUEST") public class Request { @ElementCollection private Set<String> keywords; ... } I want to be able to select the entity whos keywords exactly matches a given Set of strings. I've looked into using IN but that will match if only one keyword exists. How do I match only if all keywords exist? 回答1: The simplest approach I can think of is