Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

Hibernate query for joining two tables.



I need to join two tables User and Employee. And the query will be like,

List list = hibernateTemplate.find("from User u left join fetch u.employee e");

So what I have to do in the User,Employee POJO.
SQL requirement is SELECT userName,firstName from Employee as e LEFT JOIN User as u ON u.userId = e. userId.