Complete Spring 7 & Spring Boot 4 course from beginner to Advance using first thought principle.
Curated by: Coder Army (41 videos)
JPA relationships are not just about adding annotations. To use them correctly, you must understand how Java object references are translated into foreign keys and join tables—and which side actually controls the relationship. In this video, we build JPA relationships from first principles using Spring Boot and Hibernate. You will learn: Why relationship mapping is required Java object references versus database foreign keys One-to-One, One-to-Many, Many-to-One and Many-to-Many relationships Unidirectional versus bidirectional relationships Owning side versus inverse side How @JoinColumn works What mappedBy actually means How to maintain both sides of a bidirectional relationship Relationship helper methods Insert and update behaviour Relationship dirty checking Nullable and mandatory associations One-to-One mapping with unique foreign keys Shared primary-key mapping using @MapsId Many-to-Many mapping using @JoinTable Why Lombok @Data can be dangerous for JPA entities By the end of this video, you will understand not only how to write JPA relationship annotations, but also the database structure and Hibernate behaviour behind them. This lecture is ideal for anyone learning Spring Boot, Hibernate, JPA or Spring Data JPA and struggling with relationship ownership, mappedBy, foreign keys or bidirectional mappings. This video is part of the complete Spring Boot and Hibernate series on Coder Army. JAVA Beginner to Advance Series : https://youtube.com/playlist?list=PLQEaRBV9gAFsR15tNo2QLF9d2qc-c018p&si=lNuF5lyt4nKz9Up7 Join our WhatsApp Group: https://www.whatsapp.com/channel/0029VbBF1XKF1YlMyYuPM23s Code and Notes: Github : https://github.com/adityatandon15/Spring-Framework-Full-Course We have paid courses on DSA, Web Development , Blockchain, System Design & GenAI. Join Courses: https://strikes.in/ Coder Army Website: https://coderarmy.in/#home Coder Army App: https://play.google.com/store/apps/details?id=com.rohit.negi Connect with Aditya Tandon Instagram : https://www.instagram.com/adityatandon2 LinkedIn : https://www.linkedin.com/in/adityatandon2 Twitter : https://x.com/adityatandon02 Timestamps: