JPA继承和复合主键扩展

时间:2012-03-13 09:17:33

标签: jpa

说,我有两个(或三个)表。

PLAYER_POINT
----------------------------------------
    PLAYER_ID | PK, FK -> PLAYER
    POINT_ID  | PK, FK -> POINT
    EARNED    | INT

PLAYER_POINT_YEAR
----------------------------------------
    PLAYER_ID | PK, FK -> PLAYER_POINT
    POINT_ID  | PK, FK -> PLAYER_POINT
    YEAR      | PK
    EARNED    | INT

PLAYER_POINT_MONTH
----------------------------------------
    PLAYER_ID | PK, FK -> PLAYER_POINT_YEAR
    POINT_ID  | PK, FK -> PLAYER_POINT_YEAR
    YEAR      | PK, FK -> PLAYER_POINT_YEAR
    MONTH     | PK
    EARNED    | INT

JPA是否可以将@Inheritance用于扩展复合主键集?

1 个答案:

答案 0 :(得分:3)

PK是固定的继承树。你不能用继承做到这一点