Example:
I have a base table called Pet with a BirthDate
and Name
columns.
I have a two more tables that derive from that table, one called PetDog table with column NumberOfTeeth
and another called PetBird table with column BeakColor
.
How to implement this using Kotlin Exposed? https://github.com/JetBrains/Exposed
Or is there any documentation on this available?
What sort of database and schema do you have in mind? How does it support table inheritance? As Михаил Нафталь already mentioned in the comment, a common approach with a relational database would be to either use one table with all columns or two tables (
pet
anddog
, with some way to link the records in both tables to each other).A simple example with two tables:
Your Exposed table definition code could then look something like this: