Chapter 4. Advanced Fetching

In this chapter, we will discuss various ways to fetch the data from the permanent store. In previous chapters, we have already seen some ways to fetch the data when working with annotated entities. Now, we will focus a little more on the annotations that are related to data fetch, Hibernate Query Language (HQL), execution of native SQL, criteria objects, and filters. We will also demonstrate how to perform pagination, which is a functionality that's very common in most enterprise applications.

We will cover the following topics in this chapter:

  • Fetching strategies
  • Hibernate Query Language
  • Native SQL
  • Criteria objects
  • Filters
  • Pagination

Fetching strategy

In Java Persistence API (JPA), you can provide a hint to fetch the data ...

Get Mastering Hibernate now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.