One-to-Many Relationships in JPA (@OneToMany) Explained | Day 60
Be Software Engineer
0:00 / 0:00
One-to-Many Relationships in JPA (@OneToMany) Explained | Day 60
56 просмотров · 4 дня назад
Be Software Engineer
36 подписчиков
56 просмотров · 4 дня назад
Day 60 of the Java Backend Development + Spring Boot course. One course, many students. Today you map the "one" side of the most common relationship in real systems.
In this video, you'll learn:
How a one-to-many relationship looks in the database (Day 12's schema)
@OneToMany(mappedBy = ...) on the Course entity
Why the "many" side owns the foreign key
What goes wrong if you leave out mappedBy
Helper methods that keep both sides of the relationship consistent
This is Lesson 60 of Phase 5: JPA + Hibernate + PostgreSQL. This lesson and Day 61 are two views of the same foreign key.
📌 Previous — Day 59: One-to-One Relationships
📌 Next up — Day 61: Many-to-One Relationships
📚 Recommended Resources
📖 Spring in Action (5th Edition) — Craig Walls
👉 https://www.amazon.in/Spring-Action-F...
As an Amazon Associate, I earn from qualifying purchases.
🛒 Recommended Coding Setup
💻 Laptop for Coding
👉 https://www.amazon.in/ASUS-Vivobook-i...
⌨️ Mechanical Keyboard
👉 https://www.amazon.in/dp/B07989JYRS?t...
🖱️ Wireless Mouse
👉 https://www.amazon.in/Logitech-Silent...
🎧 Headphones / Headset
👉 https://www.amazon.in/boAt-Rockerz-42...
As an Amazon Associate I earn from qualifying purchases.
#JavaBackend #SpringBoot #JPA #Hibernate #LearnJava