Fixed DAO calls that return longs with Hibernate 4.