Chapter 12. Fetch plans, strategies, and profiles
In this chapter
- Lazy and eager loading
- Fetch plans, strategies, and profiles
- Optimizing SQL execution
In this chapter, we explore Hibernate’s solution for the fundamental ORM problem of navigation, as mentioned in section 1.2.5. We show you how to retrieve data from the database and how you can optimize this loading.
Hibernate provides the following ways to get data out of the database and into memory:
- Retrieving an entity instance by identifier is the most convenient method when the unique identifier value of an entity instance
is known: for example, entityManager.find(Item.class, 123).
- You can navigate the entity graph, starting from an already-loaded entity instance, by accessing ...