Hibernate Criteria — return records where column is distinct
问题 Sample database table: ID = 1, msgFrom = 'Hello', foobar = 'meh' ID = 2, msgFrom = 'Goodbye', foobar = 'comments' ID = 3, msgFrom = 'Hello', foobar = 'response' Sample desired output (generated by hibernate query): ID = 1, msgFrom = 'Hello', foobar = 'meh' ID = 2, msgFrom = 'Goodbye', foobar = 'comments' In the above example, the third record would be excluded from the results since the msgFrom column is the same. Let's say the Java/Hibernate class is called Message. I would like the results