Hi,
my entity ContentItem has a List tags which is stored in her own table. Now I want a list of all available tags, therefore I use the HQL query:
SELECT DISTINCT elements(tags) FROM ContentItem
which works fine.
But now I want this list to be literally sorted by tag which is a String
SELECT DISTINCT elements(tags) as singeTag FROM ContentItem ORDER BY singleTag
does not work,
SELECT DISTINCT elements(tags) FROM ContentItem ORDER BY elements(tags)
of course also does not work.
SELECT DISTINCT elements(tags) FROM ContentItem ORDER BY col_0_0_
works, but I don't really like depending on a generated name that I only know from looking at the log files, besides that my IDE is complaining. Anyone any idea how to solve this?
|