title: How to perform subquery on an @ElementCollection within the same entity?
body: <p>Consider the following entity.</p>
  
  <pre><code>@Entity
  public class Member {
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private Long id;
  
      private String memberName;
  
      @ElementCollection
      @CollectionTable(joinColumns=@JoinColumn(name="memberId"))
      @MapKeyColumn(name="prop")
      @Column(name="val")
      private Map&lt;String, Boolean&gt; checklist;
  
      /** usual getters and setters **/
  }
  </code></pre>
  
  <p>Assuming the above entity creates two table; member and member_checklist; is it possible for me to achieve the following sql statement with jpa 2 criteria api?</p>
  
  <pre><code>select * from member where id not in (
      select memberid from member_checklist where prop in (2));
  </code></pre>
  
  <p>I've read <a href="https://stackoverflow.com/questions/2735071/hibernate-criteria-api-adding-a-criterion-string-should-be-in-collection">Hibernate Criteria API - adding a criterion: string should be in collection</a> but I still can't figure out how I can achieve my goal. </p>
  
  <p>Looking forward to some expert opinions.</p>