Using Hibernate\'s Criteria API, I want to select the record within a table with the maximum value for a given column.
I tried to use Projections, creating an alias
For the max() function in hibernate:
max()
criteria.setProjection(Projections.max("e.encounterId"));