Inheritance JPA 2映射继承类型是联合的还是单一的?

Inheritance JPA 2映射继承类型是联合的还是单一的?,inheritance,annotations,jpa-2.0,discriminator,Inheritance,Annotations,Jpa 2.0,Discriminator,我有一个测试用例,它有三个表/类(Language、Caption和CaptionLanguage) 语言表存储语言数据。 标题表存储标题索引数据。 CaptionLanguage表存储每种语言的标题数据。 我可以使用哪种继承类型来解决这个问题 如果我设置“@DiscriminatorColumn(name=“ID\u LANG”,discriminatorType=discriminatorType.Integer)”, 使用“@inheritation(strategy=Inheritan

我有一个测试用例,它有三个表/类(Language、Caption和CaptionLanguage)

语言表存储语言数据。
标题表存储标题索引数据。
CaptionLanguage表存储每种语言的标题数据。

我可以使用哪种继承类型来解决这个问题

如果我设置“@DiscriminatorColumn(name=“ID\u LANG”,discriminatorType=discriminatorType.Integer)”,
使用“@inheritation(strategy=InheritanceType.JOINED)”可以吗?
不使用@DiscriminatorValue(value=“value”)


谢谢

这看起来不像是可以通过继承解决的问题。尽管名称不同,
CaptionLanguage
不是
Language
的子类型-它也不是
Caption
的子类型

相反,它看起来像三个具有以下特征的实体:

  • 语言
    字幕语言
    的一对多(和/或多对一反向)
  • Caption
    CaptionLanguage
    的一对多(和/或可能的多对一反向)
  • 标题
    到父
    标题
    (和/或一对多反向)的多对一
  • CaptionLanguage
    没有复合主键,因此应该使用

您定义了哪些实体,您正在尝试定义哪些实体?它们之间定义了什么关系?我不认为我能很好地回答您,因为我认为我在您的模型中没有看到任何继承“是-a”关系,而是“有-a”聚合类型的关系。也许你可以澄清一下?