I have a class employee. It has a primary key ID and column called supervisorID. I want to display supervisor ID as the employees name, so I must do a join back to the same table. I'm using Spring Roo and Hibernate so I need to create an HQL query to do this but I can't figure out how to translate from SQL to HQL, the below is an example of the SQL query.
SELECT e.ID, e.name AS Employee, s.name AS Supervisor
FROM employee e
INNER JOIN employee s
ON s.ID = e.supervisorID
ORDER BY e.ID;