繁体   English   中英

JPA映射:关联哪个主键是一个实体的复合主键和另一个实体的一个属性的复合

[英]JPA mapping: Assositation which primary key is compound of composite primary key of one entity and one atribute of other entity

如果您对标题感到困惑,我将尝试解释我的想法。事实上,这很简单。 我有 3 张桌子(还有更多,但现在不重要),我尝试使用 map,但它不起作用。 表:

1) 波塞塔

datumPosete , idKlijenta , UkupnaCena, idMehanicara

2) 乌斯鲁加

idUsluga

3)StavkaPosete

datumPosete , idKlijenta , idUsluge , Kolicina

我加粗主键。 如您所见,StavkaPosete 表的主键由主键 Usluga 表和主键 Poseta 表组成。 如果我犯了一些错误,我就我的英语道歉。 我也非常感谢所有回答的人。

So its CompoundIdentity then where the identity of one class includes another persistent object http://www.datanucleus.org/products/accessplatform_3_0/jpa/orm/compound_identity.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM