title: Hibernate Criteria collection property (subquery?)
body: <p>I am not very familiar with Hibernate Criteria, and apologize if this question is too simple... However, any help is greatly appreciated!</p>
  
  <p>I have two entities, CD and Track. Each CD has collection of Track-objects. In each Track there is a String-field named "title". Now I want to retrieve, using Hibernate Criteria all CDs having a Track with "title" set to a certain value. What I have so far is this:</p>
  
  <pre><code>//session handling
  Criteria cdCriteria = session.createCriteria(CD.class);
  DetachedCriteria trackCriteria = DetachedCriteria.forClass(Track.class);
  trackCriteria.add(Restrictions.eq("title", "SomeTitle"));
  trackCriteria.setProjection(Projections.property("title"));
  criteria.add(Subqueries.exists(trackCriteria));
  List&lt;CD&gt; cds = criteria.list();
  </code></pre>
  
  <p>This returns all CDs, regardless of track title. Does anybody have any suggestions?</p>
  
  <p>Thank you in advance.</p>