Skip to content
Ameen Abozaid
Planned lessonJNR-029-L06

Demo: migrating the catalog to Spring Data JPA

  • Lesson 6 of 7
  • Junior
On This Lesson 3 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

move products and categories from Spring JDBC to Spring Data JPA; prepares JNR-029-LAB1.

Draft outline details

Step by step

  1. Keep the ProductRepository contract the service uses; add JPA entities from JNR-028.
  2. Create ProductJpaRepository extends JpaRepository and adapt the existing implementation to call it.
  3. Add findBySku and a name search with @Query.
  4. Planned mistake: write a 60-character derived method name; show it, then replace it with @Query.
  5. Run the API tests; the contract is unchanged.
  6. Remove the old Spring JDBC code once tests pass.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.