Demo: mapping Shop entities and predicting the SQL
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
map Product, Category, and Money, and predict each statement; prepares JNR-028-LAB1.
Draft outline details
Step by step
- Add
spring-boot-starter-data-jpaand enable SQL logging (spring.jpa.show-sqlor theorg.hibernate.SQLlogger); setddl-auto=none. - Map
CategoryandProductwithMoneyembedded; match columns to the manualschema.sql. - Write a create-update-read sequence in a transactional test.
- Before running, write on screen the SQL you expect for each line.
- Planned mistake: map an enum without
EnumType.STRING; show the number stored, fix it. - Run and compare the log with the predictions.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.