I am using this JPA-Query (EclipseLink):
SELECT e FROM Entity e GROUP BY e.label
But i get all rows in my result instead of only the unique labels.
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:
SELECT COUNT(DISTINCT e.label) FROM Entity e
From the Hibernate JP-QL documentation:
However, it seems you want the full entities, which I don’t think is possible.