title: Criteria builder IN clause with nested query for embedded @ElementCollection
body: <p>I have the <code>User</code> and <code>Address</code> entities (actually others but for simplify).</p>
  <pre><code>@Entity
  public class User {
      @Id
      @GeneratedValue
      protected long id;
      ...
  
      @ElementCollection
      @CollectionTable(name = &quot;address&quot;,
          joinColumns = {@JoinColumn(name = &quot;user_id&quot;)})
      @Column(name = &quot;street&quot;)
      private List&lt;Address&gt; addresses;
  
      ...
  }
  
  @Embeddable
  public class Address {
      private String street;
      ...
  }
  </code></pre>
  <p>How to make nested query for <code>Address</code> and use it in <code>IN</code> clause? Result query that I expect `select * from user u where u.id in (select user_id from address where street like '%Green%');</p>
  <pre><code>Root&lt;User&gt; root = ...; // Root query already exists
  
  CriteriaQuery&lt;Address&gt; cq = builder.createQuery(Address.class);
  Root&lt;Address&gt; addressRoot = cq.from(Address.class);
  
  cq.select(addressRoot.get(&quot;user_id&quot;))
      .where(
          builder.like(
              addressRoot.get(&quot;street&quot;),
              &quot;%Green%&quot;
          )
      );
  
  Predicate .... = criteriaQuery.where(root.get(&quot;id&quot;).in(cq))
  </code></pre>
  <p>I tried something like this, but it does not work - <code>Address</code> it is not entity and I can't create <code>CriteriaQuery</code> with it.
  Important note: I can't use <code>root.join(&quot;addresses&quot;).get(&quot;street&quot;).like(...)</code> for several reasons</p>