title: using hibernate Criteria.uniqueResult() when there are several results
body: <p>I have a table USERS with names and creation dates, and an api function </p>
  
  <pre><code>T read(Criterion... criteria)
  </code></pre>
  
  <p>that searches by criterions that i cant change.</p>
  
  <p>My problem is that the function returns crit.uniqueResult() but sometimes the criteria gives many names (in which case i want only the name with the latest date).
  how can i add a criterion to make sure only the latest name is returned?</p>
  
  <pre><code>public T read(Criterion... criteria){
    Criteria crit = getSession(false).createCriteria(this.type);
    for (Criterion c : criteria) 
    {
      crit.add(c);
    }
    T entity = (T)crit.uniqueResult();
    return entity;
  }
  </code></pre>