• Post Reply Bookmark Topic Watch Topic
  • New Topic

Composite Key consisting of an Entity and a Property

 
Frankie Fuentes
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can please someone show me an exhaustive example of ways in how I could make a mapping of a primary key that consist of a property plus an entity.

Say I have:



Much appreciated.
 
Frankie Fuentes
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've found the solution:



http://download-llnw.oracle.com/javaee/6/api/javax/persistence/MapsId.html

But my problem is that @MapsId is only available for JPA 2. How should I code this for JPA 1.0?

Thanks
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!