title: Search by nested property of collection field with criteria api
body: <p>I'm trying to find all entities that have some nested elements and nested elemens have collections of elements, and I need to find it by property of those collections.</p>
  
  <p>It would be something like this</p>
  
  <pre><code>class A{
      private B b;
  }
  
  class B{
     private Collection&lt;C&gt; cCol;
  }
  
  class C{
     private String name;
  }
  </code></pre>
  
  <p>So I want to get all A elements that have B elements that have a C which name matches given parameter.</p>
  
  <p>Not sure how to do it with JPA Critieria API. I know there is in predicate, or MEMEBER OF in JPQL but I need to search by property of element in collection, not a collection member.</p>
  
  <p>Tried things like <code>root.get(a.b.c.name)</code> and also with <code>root.fetch(a.b)</code> or <code>root.fetch(b.c)</code> but always ended up with some exceptions about illegal api usage</p>