Many-to-One Relationships in JPA (@ManyToOne) Explained | Day 61
Be Software Engineer
0:00 / 0:00
Many-to-One Relationships in JPA (@ManyToOne) Explained | Day 61
35 просмотров · 2 дня назад
Be Software Engineer
36 подписчиков
35 просмотров · 2 дня назад
Day 61 of the Java Backend Development + Spring Boot course. Day 60 mapped the "one" side. Today you write the owning side, and finally retire the plain courseId number.
In this video, you'll learn:
@ManyToOne and @JoinColumn on the Student entity
Replacing courseId with a real Course reference, with the same database column
Why a unidirectional many-to-one is often all you need
Creating a student by loading and attaching a course
Mapping the relationship to DTOs, including an extra courseTitle field
How your derived queries from Day 56 keep working
This is Lesson 61 of Phase 5: JPA + Hibernate + PostgreSQL.
📌 Previous — Day 60: One-to-Many Relationships
📌 Next up — Day 62: Many-to-Many 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