Skip to content

Commit

Permalink
HHH-11729 - Add clarifications in the User Guide related to how Hiber…
Browse files Browse the repository at this point in the history
…nate FetchMode types translate to JPA
  • Loading branch information
EUROPE\cdhib authored and vladmihalcea committed May 8, 2017
1 parent 86dd0d1 commit ef8ebe0
Showing 1 changed file with 9 additions and 6 deletions.
Expand Up @@ -284,16 +284,19 @@ it allows you to fetch all the required data with a single query.
=== The `@Fetch` annotation mapping

Besides the `FetchType.LAZY` or `FetchType.EAGER` JPA annotations,
you can also use the Hibernate-specific `@Fetch` annotation that accepts one of the following `FetchMode`s:
you can also use the Hibernate-specific `@Fetch` annotation that accepts one of the following `FetchMode(s)`:

SELECT::
Use a secondary select for each individual entity, collection, or join load.
The association is going to be fetched lazily using a secondary select for each individual entity,
collection, or join load.
It's equivalent to JPA `FetchType.LAZY` fetching strategy.
JOIN::
Use an outer join to load the related entities, collections or joins.
Use an outer join to load the related entities, collections or joins when using direct fetching.
It's equivalent to JPA `FetchType.EAGER` fetching strategy.
SUBSELECT::
Available for collections only. 
When accessing a non-initialized collection, this fetch mode will trigger loading all elements of all collections of the same role
for all owners associated with the persistence context using a single secondary select.
Available for collections only. When accessing a non-initialized collection,
this fetch mode will trigger loading all elements of all collections of the same role for all owners associated
with the persistence context using a single secondary select.

[[fetching-fetchmode-select]]
=== `FetchMode.SELECT`
Expand Down

0 comments on commit ef8ebe0

Please sign in to comment.