title: How to get unique results in JPA
body: <p>I am using this JPA-Query (EclipseLink):</p>
  
  <pre><code>SELECT e FROM Entity e GROUP BY e.label
  </code></pre>
  
  <p>But i get all rows in my result instead of only the unique labels.</p>
  
  <p>My second approach was using DISTINCT like i did successfully in another function which counts the distinct values, but i don't know how apply this to get the Entities:</p>
  
  <pre><code>SELECT COUNT(DISTINCT e.label) FROM Entity e
  </code></pre>