- "I use JPA because it’s convenient as an ORM."
- I know that calling save() saves it.
- I’m not really sure about the persistence context…
[Lv2] Complete Mastery of JPA for Working Developers — From the Persistence Context to Practical Patterns
You’ve written SQL with JdbcTemplate before, right? I’m sure everyone has experienced the frustration of having to modify both the SQL and the RowMapper every time a single column changes. This course begins with that pain. A single SELECT using plain JDBC takes 35 lines. You open a Connection, create a PreparedStatement, iterate through the ResultSet, and if you forget even one close(), the server goes down. After typing through this hell yourself, encountering JPA’s one-line save() makes you feel, not just understand, “This is why people use JPA.”
128 learners
Level Basic
Course period Unlimited


Reviews from Early Learners
5.0
5.0
Bruce Han
Great things about this course - It teaches JPA very well with a focus on practical application. - Theories are explained through analogies, which helped me understand them quickly. Points to note when taking the course - You won't remember much if you just listen. That's why I think it's important to listen to one lecture, type along with the materials, and ensure you understand before moving on. Areas for improvement - There are occasional typos in the videos. For example, "polymorphism" is written as "diversity," and there are cases where words like "builder.and" are incorrectly displayed as "builder.end" in the subtitles.
5.0
안승현
I am enjoying the lectures. Subjectively speaking, this is the easiest course to understand.
5.0
부분적무료화
It explains JPA very easily and provides a clear explanation of the paradigm mismatch between objects and database tables along with relevant examples. Rather than just listing various JPA features, it recommends specific features to use and those to avoid, providing practical advice on how they are typically used in real-world development. For those already familiar with JPA in a professional setting, it serves as a great refresher course; for those using it for the first time or considering its adoption, it can be used as a guidebook to build services without much difficulty.
What you will gain after the course
The ability to explain the first-level cache, dirty checking, and write-behind fluently based on experience.
An experience that made me truly understand why JPA is necessary after personally enduring the pain of 35 lines of JDBC code.
Practical debugging skills to identify the cause by examining logs when an N+1 problem occurs, and choose the appropriate solution among Fetch Join, @EntityGraph, and @BatchSize depending on the situation
The ability to design clean, dynamic queries without if-statement spaghetti using QueryDSL’s BooleanExpression, and to integrate JPA and QueryDSL into a practical, standard architecture through the Custom Repository pattern.
From entity design through inheritance mapping, BaseEntity (Auditing), and embedded types — the design sense to decide, when starting a real-world project, not “How should we design the tables?” but “Let’s go with this pattern.”
save() works, but
if you can't explain “why”, you'll fail.
For those who have done CRUD with JdbcTemplate but get stuck at “What is the persistence context?” Experience the pain of 35 lines of pure JDBC first, then realize the greatness of JPA and become a developer who can explain its inner workings through the “pain → salvation” learning method.
Most JPA courses teach only “how.”
"Add @Entity and use save()." It works if you follow along. But interviewers ask, "How does the persistence context work?" and "How did you solve the N+1 problem?".
You stop at “Just add @Entity and use save().”
They cannot explain the principles behind the persistence context, N+1, and dirty checking.
Without experiencing the pain of writing 35 lines of JDBC, you won’t appreciate JPA.
Core concepts, explained in a way you’ll never forget after hearing them just once.
Persistence context · write-behind · lazy loading · dynamic queries · N+1 · relationships — explained through analogies rather than code, revealing “what” and “why” in full.
"What is the persistence context?"
It is explained as a secretary that works through the first-level cache and dirty checking.
"When does the INSERT go out?"
It responds that, like bundling packages together, they are collected and sent all at once., chúng được gom lại và gửi một lần.
"How does lazy loading work?"
Explains that the fake employee (proxy) loads when real work arises. sẽ tải khi có công việc thực sự phát sinh.
"How did you write the dynamic query?"
Safely at compile time with QueryDSL Lego assembly..
"How did you solve the N+1 problem?"
We answer using three methods, including Fetch Join..
"Why did you design @ManyToOne that way?"
We explain that mapping resolves the object–table mismatch. được giải quyết bằng ánh xạ.
You have to experience it firsthand for it to be etched into your bones.
You must not learn save() first. Every week, you experience “pain → salvation” firsthand. After going through the 35-line hell and the N+1 explosion, the principles behind them will flow effortlessly in interviews.
With JDBC, I wrote 35 lines for a single SELECT.
After that pain, you’ll feel the revolution of three lines with the persistence context.
EnumType omission and data corruption caused by merge().
Safely protect against this with EnumType.STRING and change detection.
Fetching 10 members triggered 11 queries.
Experience reducing it to one query with a single line of Fetch Join..
I copy-pasted createdAt into every entity.
Inherit common fields with a single BaseEntity..
A typo in a JPQL string caused a runtime failure.
Catch it at compile time with QueryDSL. tại thời điểm biên dịch.
The same questions and answers determine whether you pass.
- "When I tried doing it directly with JDBC, dealing with the mismatch between objects and tables was difficult."
- "The persistence context's first-level cache and dirty checking solved this."
- I answer N+1 with three approaches, including Fetch Join.
CRUD works, but I get stuck again in interviews.
I built CRUD with JdbcTemplate. But then the common path to rejection begins again.
This course is the core of the roadmap, Lv.2.
If you’ve built a solid foundation in Spring Boot in Lv.1, it’s now time to master JPA, one of the most widely used technologies in real-world development.
Build a strong foundation before starting Spring.
Build APIs with Spring and prepare for interviews.
From the persistence context to QueryDSL.
Once you’ve equipped yourself with practical skills, it’s time to stand out with your résumé and get past the screening stage.
Have you ever experienced something like this?
Have you ever been at a loss for words when asked, "Can you explain the persistence context?"
Have you ever been unable to give more than one answer to “Have you solved the N+1 problem?”
5 weeks, 41 lessons · From the persistence context to QueryDSL.
Persistence Context → Entity Mapping → Relationships & Proxies → Inheritance & Value Types → QueryDSL. Experience each concept as “pain → salvation.” Click a section to view the detailed table of contents.
섹션 1. 🦸 1주차 · 영속성 컨텍스트, JDBC 고통 → 구원영속성 컨텍스트
- 1😱 The pain of pure JDBC: 35 lines for a single SELECT
- 2🦸 Persistence Context: The Savior That Solved the Pain
- 3📦 First-level cache: The secret to minimizing database access
- 4🔍 Dirty checking: I know what you changed
- 5📮 Write-behind: Batch it all at once
섹션 2. 🏷️ 2주차 · 엔티티 매핑과 Spring Data JPA엔티티 매핑
- 6🏷️ A Complete Understanding of @Entity·@Table·@Column
- 7🔑 Primary Key Mapping Strategies
- 8🚽 Flush: The Moment the Water Goes Down
- 9👻 Detached state: when the assistant leaves work
- 10🎁 The pitfalls of Spring Data JPA + save()·merge()
섹션 3. 🌍 3주차 · 연관관계와 프록시·지연 로딩연관관계·프록시
- 11🌍 Object World vs. Table World
- 12↔️ Unidirectional and bidirectional relationships and the rule of the owner
- 13⚡ Eager Loading vs Lazy Loading: Why Is LAZY the Default?
- 14🎭 Proxy: The Fake Object That Enables Lazy Loading
- 15👨👦 CASCADE·Orphan Removal
섹션 4. 🧬 4주차 · 상속 매핑과 값 타입상속·값 타입
- 16🧬 Inheritance Mapping: JOIN vs Single-Table Strategy
- 17📋 @MappedSuperclass: Common Fields with BaseEntity
- 18💳 Real-world: Payment domain inheritance + AttributeConverter
- 19🎁 Value Types: Embedded and Immutable Objects
- 20📚 Limitations of Value Type Collections and Alternatives
섹션 5. 🏗️ 5주차 · QueryDSL 실무QueryDSL
- 21🏗️ Project Environment Setup and the Secrets of Q Classes
- 22🔎 Basic Syntax: Search · Sorting · Pagination · Aggregation
- 23🔗 Joins and fetch joins: The solution to N+1
- 24🚦 Dynamic Queries: BooleanBuilder and Multiple Parameters
- 25⚡ Performance Optimization: DTO Projections and Bulk Operations
If you can do CRUD but can’t explain what happens internally.
A good fit for you if
Those who have performed CRUD with JdbcTemplate but don’t know about the "persistence context"
Those who know save() but don’t know “what happens internally”
Those who can’t identify an N+1 problem when it occurs in their code
Those who want to answer “Explain the persistence context” based on experience
Those who need to align their expectations
- Those who are completely new to Spring and JPA (we recommend taking Lv.1 first)
- Those unfamiliar with Java syntax itself
- Those who insist on using only raw SQL without an ORM
Lv.2 — You can get started with experience at the Lv.1 level.
Experience working with Spring, even briefly (completing the Lv.1 Spring Boot Introduction course is recommended). dù chỉ một chút (khuyến nghị hoàn thành khóa nhập môn Spring Boot Lv.1).
Experience with MySQL CRUD..
IntelliJ Community (free) is sufficient — available for both Windows and Mac, with installation instructions for each OS.
By the end of the course, you’ll be able to do these four things.
We explain the internal workings of the persistence context's first-level cache and dirty checking..
Solve the N+1 problem in three ways, including Fetch Join. bằng 3 phương pháp, bao gồm Fetch Join.
Resolve the object-relational paradigm mismatch with relationship mapping., giải quyết sự không tương thích giữa mô hình đối tượng và mô hình bảng.
Create type-safe dynamic queries at compile time with QueryDSL..
Directly taught by a working developer who reached the final interviews at Coupang and Yanolja.
A sixth-year developer who made it to the final interviews at Coupang and Yanolja, and an instructor with a job-hunting story spanning 24 companies, teaches you directly.
Former server developer at Viva Republica (Toss) — explains the “why” from a perspective proven in real-world practice.
This isn’t a course that simply tells you “how” and leaves it at that—it connects concepts → hands-on experience → interview answers.
I run a developer employment community (KakaoTalk · Discord) and support students all the way through.
Leave a course review and receive the JPA interview questions workbook.
A Notion workbook of frequently asked interview questions and model answers on topics such as the persistence context, N+1, and QueryDSL—so you can practice directly.
Expand only the sections you're curious about to check them.
JPA를 처음 보는데 들어도 되나요?
This course is Level 2. It assumes you have either tried CRUD with JdbcTemplate or have beginner-level experience with Lv.1 Spring Boot. If you’re completely new to JPA, we recommend starting with Lv.1.
따라하기 강의랑 뭐가 다른가요?
We deliberately make you suffer first. You’ll write 35 lines of pure JDBC for a single SELECT and experience the hell of 11 queries exploding due to N+1. Only then will you truly appreciate the power of three lines for the persistence context and a single line for a fetch join. This experience will help you craft interview answers that begin with, "I’ve experienced it firsthand."
실습 환경은 어떻게 되나요?
We use IntelliJ. The Community (free) version is sufficient, and it works on both Windows and Mac. We share the learning materials (Notion and PDF) and project code.
이 강의를 들으면 어디까지 할 수 있나요?
Master the JPA concepts most commonly used in practice—from the persistence context, relationships, proxies, inheritance mapping, and value types to QueryDSL. This is Backend Roadmap Lv.2, the next step after Lv.1 (Introduction to Spring Boot).
Don’t memorize it—be able to explain the persistence context, including ‘why.’
Only after suffering through 35 lines of JDBC can you appreciate the revolution of 3 lines of JPA. Only after experiencing N+1 hell will Fetch Join be etched into your bones. Five weeks from now, you’ll be giving answers that start with, "I’ve experienced it firsthand."
Recommended for
these people
Who is this course right for?
Those who want to get a feel for what JPA is and why they should use it
Those who want to encourage interviewers to ask follow-up questions through experience-based answers
For those who understand @ManyToOne but can’t quite figure out why bidirectional relationships are needed or what mappedBy is.
For those who want to understand when queries are sent, how change detection works, and why you don’t need to use `update()`.
Those who need practical skills to read query logs and solve problems themselves
Need to know before starting?
Java Fundamentals (if Statements, for Loops, Classes, Interfaces)
Experience creating a simple REST API with Spring Boot
Experience performing basic DB CRUD operations with JdbcTemplate (SQL SELECT, INSERT, etc.)
Hello
This is dingcodingco
Inflearn Verified
Career Verified
19,853
Learners
1,996
Reviews
365
Answers
4.9
Rating
32
Courses
Get a 15% discount coupon for Dingcodingco courses
🚀 Toss and POSTECH graduate | Working backend developer (9+ years)
🎥20K YouTuber | Creates development content
📚 Inflearn instructor | 18,000+ cumulative students
👥 Runs a developer employment community (8,000+)
🧩 Contributor to numerous open-source projects (Gradle, Spring AI, etc.)
📝38 successful application processes and over 100 resume editing sessions on Kmong (5.0 rating)
I deliver vivid, real-world information in an easy-to-understand and logically structured way.
Curriculum
All
41 lectures ∙ (9hr 39min)
Reviews
All
8 reviews
5.0
8 reviews
- trixiel
Reviews 7
∙
Average Rating 5.0
5
100% enrolledI used to just add annotations without really knowing how they worked internally, but by going back and forth between the test code and the actual implementation, I was able to better understand how it works logically and why we use JPA!
- dingcodingcoInstructor
I am truly glad that you understood the principles of operation beyond the annotations. I am grateful that the way I structured it—going back and forth between test code and actual implementation so you could personally experience 'Why JPA'—seems to have been well-conveyed!
techietaekReviews 6
∙
Average Rating 5.0
5
100% enrolledThis course is designed to introduce and allow you to practice everything from the basics of JPA to production-level code. It doesn't stop at simple usage; by learning the internal working principles, I feel I was able to build an even more solid foundation! Thank you for the excellent lecture!
- dingcodingcoInstructor
I put a lot of effort into diving deep into the internal workings because I believed it would be truly helpful in practice, so thank you for appreciating that. Congratulations on completing the course!
abeb30318Reviews 6
∙
Average Rating 5.0
5
61% enrolledI am enjoying the lectures. Subjectively speaking, this is the easiest course to understand.
- dingcodingcoInstructor
Thank you so much for saying that it was easy to understand. I tried to convey the core concepts of JPA as intuitively as possible, and I feel rewarded that it seems to have resonated with you.
tarrot1415Reviews 3
∙
Average Rating 5.0
5
100% enrolledIt explains JPA very easily and provides a clear explanation of the paradigm mismatch between objects and database tables along with relevant examples. Rather than just listing various JPA features, it recommends specific features to use and those to avoid, providing practical advice on how they are typically used in real-world development. For those already familiar with JPA in a professional setting, it serves as a great refresher course; for those using it for the first time or considering its adoption, it can be used as a guidebook to build services without much difficulty.
- dingcodingcoInstructor
I am very glad that the explanation distinguishing between object and DB paradigm differences, as well as recommended and discouraged patterns in practice, was helpful. Thank you for completing the course.
- brucehan
Reviews 112
∙
Average Rating 4.5
Edited
5
100% enrolledGreat things about this course - It teaches JPA very well with a focus on practical application. - Theories are explained through analogies, which helped me understand them quickly. Points to note when taking the course - You won't remember much if you just listen. That's why I think it's important to listen to one lecture, type along with the materials, and ensure you understand before moving on. Areas for improvement - There are occasional typos in the videos. For example, "polymorphism" is written as "diversity," and there are cases where words like "builder.and" are incorrectly displayed as "builder.end" in the subtitles.
- dingcodingcoInstructor
I'm delighted to hear that the practical explanations and analogies were helpful. Thank you for meticulously pointing out the typos in the subtitles, and I believe your approach of completing the course by using both the lectures and the textbook will serve as a great reference for other students.
dingcodingco's other courses
Check out other courses by the instructor!
Similar courses
Explore other courses in the same field!







![1. Web Development Basics [HTML, CSS]Course Thumbnail](https://cdn.inflearn.com/public/courses/324886/course_cover/998919c5-399f-416c-9f57-c611ae178c51/html-css-basic-eng.png?w=420)

