TypeORM Entity Inheritance - Concrete Table Inheritance and Single Table Inheritance

preview_player
Показать описание
Inheritance helps reduce duplication in your entity definitions. By using inheritance, we can have a base class for common attributes. Other classes can extend this base class without repeating the common attributes.

TypeORM Entity Inheritance can be done in two possible ways:

- Concrete Table Inheritance: In this approach, child entities inherit from an abstract parent entity. For every child entity, a corresponding table is created in the database. Hence the name Concrete Table Inheritance.

- Single Table Inheritance: In this approach, child entities inherit from a parent entity. However, only one table is created corresponding to the parent entity. Data for the child entities are stored in the single table with an identifier field. Hence, this approach is called Single Table Inheritance.

In this video, we will be looking at both the approaches with code examples on how to implement.

00:00 - Introduction to Entity Inheritance
01:09 - Concrete Table Inheritance
03:30 - Single Table Inheritance

#TypeORM #TypeORMTutorial #Typescript

++++++++++++++++++++++++++++++++++++++++++++++++

Visit my General Tech Blog for lots of how-to articles on various technologies:

Visit my Web Development Specific Tech Blog if you are interested only about web development:

You can also check out my Github account for examples I have built:

+++++++++++++++++++++++++++++++++++++++++++++++++
Рекомендации по теме
Комментарии
Автор

Got a lot of value from this, thanks. Even better than the TypeORM docs.

biinniit
join shbcf.ru