title: How to add Distinct in Hibernate Criteria
body: <p>In my database I have a Test table, with columns: testName, testType 
  there are 2 different tests with the same type I.e "SUN", so I want only one of them for which I use Distinct in my hibernate / criteria as below, but it still giving me both the types with the same name as "sun". </p>
  
  <pre><code>        Criteria crit = session.createCriteria(Test.class);
  
      final ResultTransformer trans = new DistinctRootEntityResultTransformer();
      crit.setResultTransformer(trans);
      List rsList = trans.transformList(crit.list());
  </code></pre>
  
  <p>Any idea what could be the reason, or any other way of filtering duplicates.</p>