Example & Tutorial understanding programming in easy ways.

What is outer join fetching in Hibernate?

Outer Join Fetching in Hibernate: If database supports ANSI, Oracle or Sybase style outer joins, Outer join fetching will often increase performance by limiting the number of round trips to and from the database. This is, however, at the cost of possibly more work performed by the database itself. Outer join fetching allows a whole graph of objects connected by many to one, one to many, many to many and one to one associations to be retrieved in a single SQL SELECT.


Outer join fetching can be displayed globally by setting the property hibernate.max_fetch_depth to 0. A setting of 1 or higher enables outer join fetching for one-to-one and many-to-one associations that have been mapped with fetch="join".

Read More →