Hibernate criteria distinct on all columns
I want to create a Hibernate Criteria that selects distinct based on all
returned columns in a query. The best that I can do is to create a
ProjectionList and add each column to the list which seems very verbose
compared to SQL.
pseudo-SQL
SELECT DISTINCT parent.*, child.name
FROM parent INNER JOIN child ON parent.id = child.parent_id
WHERE child.name = 'Chris'
Note I want to do this on the database not using a ResultTransformer.
Any suggestions?
No comments:
Post a Comment