BY Default Hibernate is Lazy (using select).

 

There are 4 fetching strategies:

 

Can you guess if we are fetching the parent and we need to fetch, what could be the ways we can fetch.

 

  1. In Single query using join (FETCH- JOIN)
  2. Multiple select queries (FETCH-SELECT)
  3. By making some group of collections (FETCH-SUBSELECT)
  4. Fetching records in batch. (FETCH-BATCH)

 

 

 

Advertisements