Why EclipseLink is adding discriminator column for joined inheritance strategy?

后端 未结 1 1491
执念已碎
执念已碎 2021-01-18 04:43

I am using JOINED inheritance strategy with EclipseLink JPA implementation. I have noticed that EclipseLink is adding discriminator column, named by default DTYPE, to the da

相关标签:
1条回答
  • 2021-01-18 05:06

    From Joined Table Inheritance:

    In the joined table inheritance, each class shares data from the root table. In addition, each subclass defines its own table that adds its extended state. The following example shows two tables, PROJECT and L_PROJECT, as well as two classes, Project and LargeProject:

    ...

    The discriminator column is what determines the type and thus what joined table to use so you need a discriminator column in the parent table.

    0 讨论(0)
提交回复
热议问题