title: Java: Objects relations with criteria (hibernate)
body: <p>I have a problem with criteria and relation between objects.
  I present a simple scheme before:</p>
  
  <p>I have 2 objects:</p>
  
  <p>A is the parent
  B is the child with a link at parent.</p>
  
  <p>I know how to create a query to have B with A's restriction:</p>
  
  <pre><code>Criteria criteria = this.getSession().createCriteria(B.class);
  criteria.add(Property.forName("a.name").eq("test"));
  </code></pre>
  
  <p>But my problem is the next:</p>
  
  <p>How to retrieve all A objects with a B's restricition without direct link between A at B ?</p>
  
  <p>Thanks for your help.</p>