Start Learning
Javaneer
Back to the Spring path
🗄️
Module 3

Data & Persistence

Talk to databases without the boilerplate.

Give BookVault a real database. Spring Data JPA repositories, query methods, paging and projections, transactions that keep data consistent, relationships and the N+1 problem, schema migrations, and caching.

7 Lessons in this stage1 h 52 min
Start the first lesson

Lessons in this stage

  1. 01

    Spring Data JPA & Repositories

    Intermediate

    Map objects to tables with JPA entities, and get CRUD for free from a repository interface you never implement.

    18 min
  2. 02

    Queries: Derived, JPQL & Native

    Intermediate

    Query methods generated from their names, custom @Query in JPQL, and native SQL when you need it.

    16 min
  3. 03

    Paging, Sorting & Projections

    Intermediate

    Return one page at a time with Pageable, sort results, and fetch only the columns you need with projections.

    14 min
  4. 04

    Transactions with @Transactional

    Advanced

    Make multi-step changes all-or-nothing, understand propagation and rollback, and avoid the common pitfalls.

    18 min
  5. 05

    Relationships & the N+1 Problem

    Advanced

    Model @OneToMany/@ManyToOne, understand lazy vs eager loading, and slay the notorious N+1 query problem.

    18 min
  6. 06

    Database Migrations with Flyway

    Intermediate

    Version your schema in checked-in SQL so every environment and teammate gets the same database, reproducibly.

    14 min
  7. 07

    Caching & Beyond JPA

    Intermediate

    Spring's caching abstraction with @Cacheable, plus when to reach for JdbcClient, MongoDB, or Redis.

    14 min

Ready to test yourself?

Take the stage assessment to check your mastery. Pass it to earn a stage badge toward your Javaneer certificate.

Take the assessment