Again, not enough information. I have theories, though. SQLQuery requires that you specify the return types. Try this:
Code:
List list = session.createSQLQuery(query.toString())
.addScalar("NAME_ID", Hibernate.INT)
.addScalar("TYPE", Hibernate.INT)
.list();
Obviously, adjust the types to suit.
If a Student class has nothing but those two fields, and you want to have Hibernate create a Student object from each row, then you can change that to
Code:
List list = session.createSQLQuery(query.toString())
.addEntity(Student.class)
.list();