Spring Boot | Spring Data JPA Many To Many Bidirectional Relationship Example | JavaTechie

preview_player
Показать описание
In this tutorial, you'll learn how to map a many-to-many bidirectional relationship using Spring Data JPA and MySQL in a Spring Boot application. Many-to-many relationships are one of the most commonly used association mappings. They require an additional database table to hold the primary keys of both relationship tables.

Spring boot microservice Live course Just started
Hurry-up & Register today itself!

PROMO CODE : Java40

GitHub:

Blogs:

Facebook:

guys if you like this video please do subscribe now and press the bell icon to not miss any update from Java Techie

Disclaimer/Policy:
--------------------------------
Note : All uploaded content in this channel is mine and its not copied from any community ,
you are free to use source code from above mentioned GitHub account
Рекомендации по теме
Комментарии
Автор

I've been stuck for hours not being able to create the bidirectional relationship, it was always caught from only the one end and I was going mad as to why... and it turned out it is the thing you mention at 6:28, because I was using @Data in both places. Thank you so much man, appreciate the tutorial!

antoniyhristov
Автор

Great tutorial! Many-to-many relationships are so common in most applications. Yet I often see people struggle with setting up the relationships in the entities - they assume there has to be ONE right way of doing it, not realizing that EACH entity can own the relationship.

alexgutjahr
Автор

Excellent video in terms of keeping it simple throughout focussing on the core basic of many to many!! One of the best out there.Thank you.

pranaypaul
Автор

Thank you for helping me understand how to use JPA and Many-to-Many relationships clearly..

g.ariywt
Автор

Thanks you so much. I am also facing stack overflow due to @Data annotation . I didn't know that. Thank You sir.

SumanMondal-gvbi
Автор

This tutorial is a successful in explaining explain ManyToMany Relationships in Java! ✔️You made it easy to follow! ✔️Thanks alot Java Techie 💙

musanzawanga
Автор

good presentation but you should give all type of operations from both sides

hkkabir
Автор

In many to many directional, there are challenges in add & delete please discuss on that

PradeepKumar-sxms
Автор

Exactly what i needed. Great job. Thanks !

georgikyshenko
Автор

Thanks for the informative video, one request - if you give quick summary at the end of the video i.e. what we did from start to end with the code, it will be very easy to remember the things.

shubhamtopare
Автор

Hii in my project I am facing one problem, user having usercart that usercart contains products, if i add product it mapped to cart of a particular user, if add another product for same user cart it overrides the previous one how to overcome this situation .

thimothipalipaka
Автор

Java techie please help me I am getting error 415 in postman while inserting the says the message type is not supported I tried using header as content type application json yet it doesn't work

rakshitmandilwar
Автор

when u fire find all couse student not include but we have bidrectional mapping ? so whats is the point to use @JsonBackRefrence Any Other Solution

lovetyagi
Автор

How can I add same course for 2 different students?

shubhamkale
Автор

Thanks for sharing the valuable knowledge, but I request you to please use mice as audio of your videos is very less.
Also it will be so great help if you explain few of the concepts. I mean, why we are doing this way like.

sumithulsurkar
Автор

Hi Basant, I have one small Doubt.
In this Example fetch type is Lazy but while fetching student details, Course Details is getting Populated.
I am getting Confused.
Can you Please Clarify this. Thanks

ANANDKUMAR-
Автор

Its really a good aproach, Thanks Techie

sandeeps
Автор

Maybe I'm wrong, but it seems to be bad. There's no many to many relationship if CRUD is controlled by Student entity, because there's not going to occur the same course for another student. If you delete a student, then all Courses that this Student owns will be deleted from Course entity too

YtSeshomaru
Автор

Thank u so much....its very helpful vedio....to understand many to many bring more vedios like as....also request bring the vedio on online shopping in springboot with react js...

rekhapandit
Автор

Thank you! I have question for 33:46: basically I'm confused that you used FetchType LAZY but yet findById method is still populating the list of courses eagerly. I have the same behavior, but I question why

bluex