Avoid duplicates in child object using Criteria
<p>I can simple create:</p>

<pre><code>DetachedCriteria uniqueRequisition = DetachedCriteria.forClass(Requisition.class);
uniqueRequisition.setProjection(Property.forName("primaryKey"));
uniqueRequisition.add(Restrictions.eq("primaryKey", 1160));
</code></pre>

<p>and it returns all parent entities for those children, which contain <code>primaryKey=1160</code>.</p>

<p>How can I return only those parents without repeat child <code>primaryKey</code> value?</p>

<p>I mean, if there are two parents with equal child, it should return only one parent and not all parents.</p>