Uploaded image for project: 'Hibernate ORM'
  1. HHH-10485

Lazy collections fetched with EntityGraph load with JOIN

    Details

    • Last commented by a user?:
      true
    • Sprint:

      Description

      When a @OneToMany(fetch = FetchType.LAZY) List<Bean> beans is included with an EntityGraph, it is loaded with the owner entity with a JOIN. Is this configurable? I tried adding @Fetch(FetchMode.SELECT) but it gets ignored.
      Since I need to skip/limit using firstResult()/maxResults(), using EntityGraphs I get

      firstResult/maxResults specified with collection fetch; applying in memory!

      and having huge result set (over 100000 records, without skip/limit) the query takes minutes.
      Using FetchType.EAGER the collection is fetched with a second query, without JOIN.

      Is the JOIN fetching hardcoded when using {{EntityGraph}}s? Or is it configurable?

        Attachments

          Activity

            People

            • Votes:
              4 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: