开发者

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

开发者 https://www.devze.com 2023-03-20 19:59 出处:网络
If you are confused with title, i will try to explain what i was thinking.In matter a fact it\'s pretty simple.

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

精彩评论

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