This simple query
session = com.jthink.songlayer.hibernate.HibernateUtil.getSession();
Query q = session.createQuery(\"recNo from SongChanges\");
The SELECT clause provides more control over the result set than the from clause. If you want to obtain few properties of objects instead of the complete object, use the SELECT clause. Following is the simple syntax of using SELECT clause to get just name field of the Employee object:
String hql = "SELECT E.name FROM Employee E";
Query query = session.createQuery(hql);
List results = query.list();
If you want whole object that time "select * from" is not needed.