No video

Composition vs. Inheritance with JPA and Hibernate

  Рет қаралды 5,666

Thorben Janssen

Thorben Janssen

Күн бұрын

In today’s video I will compare Composition over Inheritance.
Like all object-oriented programing languages, Java supports the fundamental concepts of inheritance and composition.
There is an important difference between both concepts. Inheritance enables you to model an is-a association between two classes by extending a superclass. Composition models a has-a association by referencing another class in an instance variable.
You can use both concepts with JPA and Hibernate. But when should you use which one and what is the best way to do that?
For plain Java classes, there have been hundreds of discussions about this question. And there is a clear winner.
If you like this video, please give me your thumbs up and share it with your friends and co-workers.
Ultimate Guide to Association Mappings with JPA and Hibernate: www.thoughts-on-java.org/ulti...
Like my channel? Subscribe!
➜ bit.ly/2cUsid8
Join the free Member Library:
goo.gl/dtyIIC
Read the accompanying post: www.thoughts-on-java.org/comp...
Want to connect with me?
Blog: www.thoughts-on-java.org/
Twitter: / thjanssen123
Facebook: / thoughtsonjava

Пікірлер: 1
@modraccin9514
@modraccin9514 4 жыл бұрын
Hi! Thank you for sharing your knowledge. Your statement "Relational databases don't support inheritance" seems to be wrong though. AFAIK PostgreSQL supports inheritance since version 9.4, which was released at the end of 2014.
Why Favor Object Composition Over Class Inheritance? A Deep Dive
19:00
Doing This Instead Of Studying.. 😳
00:12
Jojo Sim
Рет қаралды 17 МЛН
小宇宙竟然尿裤子!#小丑#家庭#搞笑
00:26
家庭搞笑日记
Рет қаралды 13 МЛН
Я обещал подарить ему самокат!
01:00
Vlad Samokatchik
Рет қаралды 9 МЛН
Iron Chin ✅ Isaih made this look too easy
00:13
Power Slap
Рет қаралды 36 МЛН
Ultimate Guide to Implementing Equals & HashCode with Hibernate & JPA
13:51
Composition Over Inheritance
4:46
Awesome
Рет қаралды 15 М.
Difference between JPA, EclipseLink & Hibernate
10:20
Thorben Janssen
Рет қаралды 29 М.
Using jOOQ with Hibernate: A Match Made in Heaven
9:46
Thorben Janssen
Рет қаралды 7 М.
Understanding Java Composition Part 1
17:17
The Learn Programming Channel
Рет қаралды 30 М.
Composition over Inheritance [Object Oriented Programming]
13:29
Composition over Inheritance
8:34
Fun Fun Function
Рет қаралды 509 М.
Rust Data Modelling Without Classes
11:25
No Boilerplate
Рет қаралды 167 М.
JPA & Hibernate: Basic Annotations You Need To Know
15:11
Thorben Janssen
Рет қаралды 30 М.
Doing This Instead Of Studying.. 😳
00:12
Jojo Sim
Рет қаралды 17 МЛН