title: Using Hibernate's Criteria and Projections to Select Multiple Distinct Columns
body: <p>Using Hibernate's Criteria, I want to execute the equivalent of:</p>
  
  <pre><code>select distinct uspscity, state from citycomplete where USPSCITY = 'HOUSTON'
  </code></pre>
  
  <p>I thought doing the following would yield the results I wanted:</p>
  
  <pre><code>ProjectionList projList = new ProjectionList();
  projList.add(Projections.distinct(Projections.property("id.state")));
  projList.add(Projections.distinct(Projections.property("id.uspsCity")));
  criteria.setProjection(projList);
  </code></pre>
  
  <p>But, what this actually does is execute something like:</p>
  
  <pre><code>select distinct uspscity, distinct state from citycomplete where USPSCITY = 'HOUSTON'
  </code></pre>
  
  <p>Which throws an error, obviously.</p>
  
  <p>Other than not using Criteria, is there a solution for this?</p>
  
  <p>Thanks,</p>
  
  <p>Brandon</p>