I\'ve got List. And I want to get max result using Collections. This is my code:
List dynamics=spy
You need to add an alias for the count to your query and then use the addScalar() method as the default for list() method in Hibernate seams to be BigInteger for numeric SQL types. Here is an example:
List sqlResult = session.createSQLQuery("SELECT column AS num FROM table")
.addScalar("num", StandardBasicTypes.LONG).list();