#04 - OneToOne Entity Relationship JPA | JAVA PERSISTENCE API JPA | Tutorial | Java

preview_player
Показать описание
✅ JPA Entity Relationship, One To One Relationship
The relations are more effective between tables in the database. The entity classes are treated as relational tables, the relationships between Entity classes are as follows:

- @ManyToOne Relation
- @OneToMany Relation
- @OneToOne Relation
- @ManyToMany Relation

In this video, we are going to learn the OneToOne Relationship in Java Persistence API (JPA).
In the One-To-One relationship, one item can belong to only one other item. It means each row of one entity is referred to one and only one row of another entity.

We are going to use the Student entity defined in the previous video and we are going to implement a new Entity called: School.
During this video, we are going to use the H2 database for database operations.

OneToOne | EntityManager | EntityRelationship

0:00 Introduction
0:12 JPA Entity Relationship
0:28 OneToOne Relationship
1:00 Create the OneToOne Relationship
1:30 Create School Entity
2:45 Implement addSchool
4:30 Create SchoolRepository
7:11 Persist School
8:40 Assign School to Student

❤️Let's start and please enjoy the video.

Thanks for watching!

✍️ If you have any questions or doubts don’t hesitate to write them inside the comments section below.

●▬▬▬ LINKS ▬▬▬●

📚 Blogs to follow to learn more about JPA:

SUBSCRIBE:
🔔 Subscribe to my Channel to always keep updated about the new video:

💯 FOLLOW ME:
▶Twitter:
▶Linkedin:
▶YouTube:

🎵 TRACK INFO: @RoaMusic
~~Roa Music~~
▶YouTube
▶Spotify
▶Soundcloud

#JavaPersistenceAPI #JPA #Tutorial
Рекомендации по теме
Комментарии
Автор

Thanks. This subject was what I was waiting for, storing objects in objects! That makes it almost as good as serializing an object and all its sub objects. Very well explained. This is such an exciting topic. I can soon use Java for my website, I hadn't thought of it before, it's the top of what I am learning about Java.

jan-willemloijson
Автор

Great videos, but I wish they emphasized more on the annotations "OneToOne", "MappedBy", "Entity(name = ...)", Table() ... etc.
Basically the parts one usually have to research in order to understand.

SimpleCookiee