In this section, you will learn about types of outer 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 Outer Join please go through the below links :
|
Recommend the tutorial |
Ask Questions? Discuss: Hibernate Outer Join
Post your Comment