OneToMany and ManyToOne Mapping in hibernate

preview_player
Показать описание
In this video you will learn How One To Many And Many to One Mapping works in Hibernate using a demo project
Below is the GitHub link to download source:
Рекомендации по теме
Комментарии
Автор

Do I understand correctly that if there are two entities with a One-to-Many relationship, such as Employee and EmployeePhones. Then you need to receive such data on the server in DTO with one call, but with two separate json? And write down one by one: first the employee, get the ID from the saved employee, and then we record the phones using this ID for communication.

Das.Kleine.Krokodil
Автор

Actually I think that on @ManyToOne fetch type is EAGER by default, so that means whenever you fetch Address it will fetch Employee in same query.
it is presented in console as well, as both system.out.println are presented one below another. Otherwise, it will be presented like: 1. query, 1. sysout, 2. query, 2. sysout

VLADICAKG
Автор

hello sir what if we do not put if condition

Nitya-tsqg
Автор

hello kishan i like to see your channel i learn lots of java concept from your channel
hey kishan can u make video on eclipse shortcut keys that makes me experience developer

sumankumar-hmsh
Автор

Nice way to do mapping if you do not want associative entities.

boikimphore
Автор

Not working for me Sir. Hibernate runs into some infinite loop while doing as suggested.

suresh