-->
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: Mapping problem for composite key with entities
PostPosted: Thu Apr 16, 2009 2:21 pm 
Newbie

Joined: Thu Apr 16, 2009 2:18 pm
Posts: 1
I have the REGION table:

Code:
REG {
    id number,
    dateCreation Date
  }


I have a LOCALE table:

Code:
LOCALE {
     locale String
  }


I have a REGION_DESCRIPTION table:
Code:
REGION_DESCRIPTION {
     locale String,
     regId number,
     description
  }


REGION_DESCRIPTION has a composite key: locale is a foreign key pointing to the LOCALE table. And regId points to the REGION table.

I would like to map this to my Region java class:

Code:
private List<RegionDescription> descriptions;


I tried different approache in JPA. But I cannot get the mapping to work. Any suggestions?


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.