Tag: jpa
All the articles with the tag "jpa".
-
Spring Boot #4 — Transactions, Relationships, N+1, and Fetch Join
I connected entities with @ManyToOne and ran a full query, and instead of 1 query, 6 came out. I fixed the N+1 problem caused by LAZY loading with fetch join, and worked through the atomicity and dirty checking of @Transactional.
-
Spring Boot #3 — Connecting PostgreSQL with JPA · CRUD with Entities and Repositories
I replaced the in-memory List CRUD with an actual PostgreSQL setup. From build.gradle dependencies to application.properties, from record to @Entity, why JpaRepository is an empty interface but CRUD still works, and the dividend of layer separation where I didn't change a single line in the controller.