-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Maps composite primary key as foreign key
PostPosted: Tue Sep 16, 2014 8:29 am 
Newbie

Joined: Tue Sep 16, 2014 8:20 am
Posts: 1
Hi, I have a big problem. I am a beginner with Hibernate.
I am trying to map a database tables to java class with JPA Annotations.
I have a table with a composite primary key. A part of this primary key is a foreign key to another table.
I try to be more clear:
TABLE_A(
el1 int,
el2 int,
primarykey(el1, el2)
)

TABLE_B(
el1_a int,
el2_a int,
el3 int,
primarykey(el1_a,el2_a,el3),
foreignkey (el1_a, el2_a) references TABLE_A(el1,el2)
)

How do I map TABLE_B to java class with JPA annotations?
Thanks a lot.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.