开发者

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

If you are confused with title, i will try to explain what i was thinking.In matter a fact it's pretty simple. I have 3 tables (there is more, but it's not important now), which i try to map, but it don't work. Tables:

1) Poseta

datumPosete, idKlijenta, UkupnaCena, idMehanicara

2) Usluga

idUsluga, NazivUsluge

3) StavkaPosete

datumPosete , idKlijenta, idUsluge, Kolicina

I bold primary keys. As you can see primary key of StavkaPosete table is composed of primary key Usluga table and 开发者_运维知识库primary key Poseta table. I apologise on my English, if I made some mistakes. Also I am very grateful everybody who answer.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜