inflearn logo
inflearn logo

Data Modeling using JPA

This course focuses more on data modeling through entity design than on JPA technical explanations. Based on the principle that solid DB design is the foundation of application development, we analyze various design patterns—such as one-to-many, many-to-many, inheritance, and collections—alongside business scenarios. You will learn by directly observing the process of code being transformed into actual tables on screen. To ensure immediate practical application, we provide business use cases, source code, and test codes for each design pattern.

18 learners are taking this course

Level Intermediate

Course period Unlimited

Java
Java
MySQL
MySQL
Spring Boot
Spring Boot
JPA
JPA
JUnit
JUnit
Java
Java
MySQL
MySQL
Spring Boot
Spring Boot
JPA
JPA
JUnit
JUnit

What you will gain after the course

  • Data modeling ability to convert business requirements into JPA entity structures

  • The ability to design associations by selecting and implementing one-to-one, one-to-many, many-to-many, and ternary relationships according to the specific situation.

  • The ability to design a domain with an inheritance structure using the most appropriate method among the four inheritance mapping strategies.

  • The ability to understand the characteristics of each collection type, such as Set, List, Map, and Bag, and map them correctly.

  • The ability to establish the correct structure from the entity design stage in actual projects.

  • The ability to express complex domains using various patterns such as intermediate entities and embeddable classes.

  • The ability to predict and verify how designed entities are created as actual database tables.

📢 Course Introduction

This course is designed to help developers who already know JPA find the answer to the question, "How can I properly design entities?"

Data modeling is the cornerstone of an application. If you establish a solid entity design in the early stages, the subsequent repositories, queries, and business logic will flow much more naturally. This course focuses on entity design itself rather than just explaining JPA technology. Instead of simply showing code, we will analyze together "why this relationship was chosen" and "why this mapping strategy is appropriate" from a business scenario perspective.

We cover various patterns used in practice, ranging from basic relationships like one-to-many, one-to-one, and many-to-many to inheritance mapping, collection mapping, and ternary relationships. By displaying entity code and auto-generated MySQL tables side-by-side on the screen, you can visually track the flow of the design. The documents, source code, and JUnit test codes used in the lecture are also provided.

I recommend this to those who know the basics of JPA but lack confidence in design, and those who want to develop data modeling skills that can be applied immediately in practice.

✨ Key Highlights of the Lecture

  • We focus on developing actual design intuition rather than grammatical explanations.

  • For each design pattern, we analyze business scenarios together so you can understand "why this structure" was chosen.

  • Directly compare the entity code and the automatically generated MySQL tables side-by-side to visually verify the design results.

  • From basic associations to inheritance, collections, and ternary relationships, this course covers various patterns used in practice all in one lecture.

  • We provide additional similar business cases so that you can immediately apply the patterns you have learned.

  • Lecture documents, source code, and even JUnit test code are all provided to enable practice-oriented learning.

  • It covers design patterns that can be applied immediately in real-world projects, rather than just staying at a theoretical level.

📘 What you will learn in this course

1. Basic JPA Entity Mapping

Understand the concepts and differences between entities and value types, and learn about identifier generation strategies, table name overriding, MySQL type mapping, and DDL auto-generation methods. You will build a solid foundation in entity design by using core annotations such as @Column and @Embedded to design embeddable classes and map nested components.

2. Inheritance Mapping Strategies

Learn how to compare four strategies for representing domain models with inheritance structures in JPA (Single Table, Joined, Table-per-Concrete-Class, and Mixed Strategies) and choose the right one for each situation. You will develop the ability to correctly model domains with complex inheritance structures by covering inheritance of embeddable classes, polymorphic many-to-one relationships, and polymorphic collection design.

3. Collection Mapping

You will learn the characteristics of various collection types such as Set, Bag, List, and Map, and how to map them correctly in JPA. You will gain an understanding of the differences and practical uses of sorted collections (Map, Set) versus sequential collections (LinkedHashSet, ArrayList, LinkedHashMap), and cover a wide range of topics including how to design value type collections such as component sets, bags, and maps.

4. One-to-Many Relationships

We compare the implementation methods of unidirectional and bidirectional one-to-many relationships and learn how to implement one-to-many associations in various ways, including optional one-to-many relationships using join tables, one-to-many associations of embeddable classes, and link table design using @JoinTable.

5. One-to-One Relationships

You will learn four ways to represent one-to-one relationships, including primary key sharing, foreign primary key generators, foreign key join columns, and the use of join tables. By comparing the characteristics, pros, and cons of each method, you will develop the ability to choose a design that fits specific business requirements.

6. Many-to-Many and Ternary Associations

Learn how to implement unidirectional and bidirectional many-to-many relationships and how to design them more flexibly using intermediate entities. Furthermore, you will acquire the ability to represent complex domain relationships by covering ternary relationships using components and Map data structures, as well as advanced relationship design patterns utilizing key/value structures.

Recommended for
these people

Who is this course right for?

  • Backend developers who know basic JPA syntax but feel overwhelmed about how to start entity design in a real project.

  • A developer who repeatedly experiences overturning table structures midway through development after creating entities carelessly.

  • Developers who understand basic relationships like one-to-many or many-to-many, but find themselves stuck when faced with complex business domains.

  • A developer who has self-taught JPA but has never properly organized advanced design patterns such as inheritance mapping and collection mapping.

  • A developer who is trying to transition from MyBatis to JPA but is struggling with how to approach it from a data modeling perspective.

Need to know before starting?

  • Java Basic Syntax (Classes, Inheritance, Interfaces, Annotations, etc.)

  • JPA Basic Concepts and Usage (Persistence Context, Basic Annotations, etc.)

  • Spring Boot Basic Project Configuration and Execution Method

  • MySQL Basic Usage (Reading Table Structures, Understanding Basic SQL)

  • Experience in writing basic JUnit test cases

  • Basic database design concepts (PK, FK, normalization, etc.)

  • Basic experience using Spring Data JPA (Repository interfaces, etc.)

Hello
This is oncoding

431

Learners

7

Reviews

19

Answers

4.7

Rating

3

Courses

Curriculum

All

57 lectures ∙ (10hr 21min)

Published: 
Last updated: 

Reviews

Not enough reviews.
Please write a valuable review that helps everyone!

oncoding's other courses

Check out other courses by the instructor!

Similar courses

Explore other courses in the same field!

Limited time deal

$22,000.00

50%

$34.10