Java Spring Boot - JPA - Hibernate - H2 - Entities Inheritance Mapping - Single Table Strategy

  Рет қаралды 12,081

CodeForgeYT

CodeForgeYT

4 жыл бұрын

In the first place we will configure database connection. Later in the video we will learn how to use inheritance together with JPA and Hibernate in Java Spring Boot application. We will create abstract super class (parent class) and then two sub-classes (child classes) which will inherit all of the properties and mapping information from parent class. We will use @Inheritance annotation to specify strategy which we will use. This time it will be SINGLE_TABLE strategy. Because of that we will also have to define information about our discrimnator column using @DiscrimnatorColumn annotation. Moving forward we will also define @DiscrimnatoValue annotations on our sub-classes. Thanks to that we will be able to distinguish persisted objects entries in the database. In our sub-classes we will also use @Enumerated annotation to learn how to persist enums. In the final stage we will learn how to use inheritance in case of repositories which we will use to persist and delete our entities from the database. We will track everything using H2 web console. Keep coding!
Joined table source code: github.com/codeforgeyt/jpa-in...
Joined table video: • Java Spring Boot - JPA...
Single table source code: github.com/codeforgeyt/jpa-in...
Single table video: • Java Spring Boot - JPA...
Superclass source code: github.com/codeforgeyt/jpa-in...
Superclass video: • Java Spring Boot - JPA...
Table per class source code: github.com/codeforgeyt/jpa-in...
Table per class video: • Java Spring Boot - JPA...
Follow //CodefForgeYT on:
FB: / codeforgeyt
Twitter: / codeforgeyt
GitHub: github.com/codeforgeyt
Instagram: / codeforgeyt

Пікірлер: 19
@deepusasidharan2012
@deepusasidharan2012 2 жыл бұрын
Superb one
@user-is8kr8vy6h
@user-is8kr8vy6h 2 жыл бұрын
perfect tutorial with nice example and easy england language for russians, tnx!))
@CodeForgeYT
@CodeForgeYT 2 жыл бұрын
Glad you liked it!
@fredericoguilhermedeolivei2882
@fredericoguilhermedeolivei2882 Жыл бұрын
Really helpful tutorial, thanks!
@vacsa
@vacsa 3 жыл бұрын
You save my time ! Thank you very much bro!
@CodeForgeYT
@CodeForgeYT 3 жыл бұрын
Hey! Glad to hear that. You are welcome!
@nizarnasraoui7987
@nizarnasraoui7987 3 жыл бұрын
thank you very much you have saved my life :))))))
@CodeForgeYT
@CodeForgeYT 3 жыл бұрын
Happy to help! Keep coding!
@dhandapani.sudhakar
@dhandapani.sudhakar 2 жыл бұрын
It is really helpful, Thanks a lot.
@CodeForgeYT
@CodeForgeYT 2 жыл бұрын
Glad to hear that
@sqb8980
@sqb8980 Жыл бұрын
youre awesome , i subscribed
@meicochief
@meicochief 4 жыл бұрын
Thank for this video, it's been really helpful
@CodeForgeYT
@CodeForgeYT 4 жыл бұрын
Happy to help!
@MrAndykofi
@MrAndykofi 3 жыл бұрын
Nice one, thank you.
@CodeForgeYT
@CodeForgeYT 3 жыл бұрын
Thanks and you are welcome!
@tresornaruffygo1816
@tresornaruffygo1816 2 жыл бұрын
what if i want to get all ArtPieces object? Can I add a specified method to find let's say by author's name directly in the ArtPiece repo interface?
@sebastianbejarano350
@sebastianbejarano350 Жыл бұрын
I have a question, I want to get a child class as its parent, meaning I will use ArtPieceRepository instead of the specified ones, what should I do?
@sivaraman8067
@sivaraman8067 3 жыл бұрын
would be usefull if you could share the code via a git commit or code snippet , helpful video as always
@CodeForgeYT
@CodeForgeYT 3 жыл бұрын
Added to each video. Keep coding!
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 59 МЛН
Amazing weight loss transformation !! 😱😱
00:24
Tibo InShape
Рет қаралды 65 МЛН
Finger Heart - Fancy Refill (Inside Out Animation)
00:30
FASH
Рет қаралды 29 МЛН
JPA/Hibernate Fundamentals 2023 - Lesson 8 - Entity Inheritance
41:45
Single table inheritance strategy in hibernate
9:45
KK JavaTutorials
Рет қаралды 6 М.
Table Per Class inheritance strategy in hibernate
10:32
KK JavaTutorials
Рет қаралды 5 М.
Part 1 - Relationships in Hibernate Using SpringBoot OneToMany and ManyToOne
9:08
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 59 МЛН