The best way to map a bidirectional JPA OneToMany relationship

The best way to map a bidirectional JPA OneToMany relationship

Vlad Mihalcea

3 года назад

15,305 Просмотров

Learn how to map a bidirectional JPA OneToMany relationship using the ManyToOne and OneToMany annotations.

Тэги:

#JPA #Hibernate #OneToMany #one-to-many #relationship #mapping #association
Ссылки и html тэги не поддерживаются


Комментарии:

Sports
Sports - 03.12.2021 05:54

Excellent quality content, thank you!

Ответить
Nourelislam Zouar
Nourelislam Zouar - 25.11.2021 18:47

I find your JPA/Hibernate tutorials the best ever, thank you!

Ответить
Akash Jadhav
Akash Jadhav - 25.05.2021 07:45

thank you for this tutorial Sir, I was looking for Utility methods and its working, now I have one question. I am using Spring Data JPA, I have Class name Hotel in which I have MenuItem [OnetoMany ], DeliveryPartner [ManyToMany] and Address [ OneToOne ], I also added Add Remove utility methods for these on Parent Hotel Entity , now when I am editing hotel by adding just one 'Delivery' in Set<> and call Hotel.save() it will call save Hotel Method and then it executes 14 insert statements, as its is executing AddDelivery(), AddMenu() AddAddress() just to save one delivery it call's all the add Utility methods. Is there better any solution ?

Ответить