Hibernate Tip: How to Map a Bidirectional Many-to-One Association

preview_player
Показать описание

JPA and Hibernate allow you to map associations in many different ways. And today I want to show you, how to map a bidirectional many-to-one association.

If you like this video, please give me your thumbs up and share it with your friends and co-workers.

Like my channel? Subscribe!

Join the free Member Library:

Want to connect with me?
Рекомендации по теме
Комментарии
Автор

1:10 why do you call "private Book book" class variable an "Entity attribute"?

AndrewGru
Автор

Hello.

I have 2 questions:
- related to method public void addReview(Review review) - should be also syncronized?
- entity object is singleton? - if there are 2 threads that want to load the same object from db using findById(), they will share the same object?

Many thanks.

georgedinu
Автор

this is good. But I getting a problem when I try to get reviews from the book. ps. I am using the EntityMaanager bean by directly injecting it in springboot.

ianwanjala
Автор

Nice video
Need full source codes of the classes

kayeshparvez
Автор

You need @JasonBackReference to avoid looping while serialisation

YogeshHShenoy
Автор

This je Manytoone-onetomany association not manytoone-manytoone

adrienmbiandji