In this section, you will learn about types of joins in Hibernate.
What is Join in SQL?
A SQL join combines the matching records from the two database tables. The matching record is on the basis of some condition, which we will provide with the query. The simple SQL query is given below : (not for Hibernate)
SELECT Student.LastName, Student.FirstName, Enrollment.EnrollNo FROM Student INNER JOIN Enrollment ON Student.EnrollNo=Enrollment.EnrollNo ORDER BY Student.LastName
Join is of three types :
select e.firstname,e.lastname,e.cellphone,a.city,a.state,a.country from Employee e inner join e.address as a
select e.firstname,e.lastname,e.cellphone,a.city,a.state,a.country from Employee e left join e.address as a
select e.firstname,e.lastname,e.cellphone,a.city,a.state,a.country from Employee e right join e.address as a
For Complete tutorial on the above please go through the below links :
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Hibernate Join
Post your Comment