In hibernate I can do following
Query q = session.createQuery(\"from Employee as e);
List emps = q.list();
Now if I want to
You should use a new object to hold these values, just like this:
"SELECT NEW EmpMenu(e.name, e.department.name) "
+ "FROM Project p JOIN p.students e " + "WHERE p.name = :project "
+ "ORDER BY e.name").setParameter("project", projectName).getResultList()
I've got this example from http://www.java2s.com/Tutorial/Java/0355__JPA/EJBQLCreatenewObjectInSelectStatement.htm