intermediate~3h

Projections, Pagination & Sorting

Loading full entities and unbounded result sets is wasteful by default — projections fix over-fetching in shape, pagination fixes it in size, and Page/Slice/Stream trade off cost against what information you actually need.

Learning objectives

  • Explain the performance difference between an interface projection and loading a full entity.
  • Choose correctly between Page, Slice, and Stream based on an endpoint's actual requirements.
  • Explain why unbounded pagination on a public endpoint is both a performance and a resource-protection risk.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.

Projections, Pagination & Sorting

Next Step

Continue to Entity Mapping — @Entity, @Id, Inheritance & Composite Keys← Back to all Spring Data JPA & Hibernate Mastery chapters