gpt4 book ai didi

JPA继承和复合主键扩展

转载 作者:行者123 更新时间:2023-12-04 05:54:31 27 4
gpt4 key购买 nike

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

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扩展复合主键集?

最佳答案

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

关于JPA继承和复合主键扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9681214/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com