-->
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.  [ 2 posts ] 
Author Message
 Post subject: A Foreign composite key problem...
PostPosted: Thu Jun 12, 2008 9:59 pm 
Newbie

Joined: Sun Apr 20, 2008 8:11 pm
Posts: 10
Hello guys,

Here is my mapping problem:

I have a class A with the following fields:

Code:
Class A:
- ID (primary key)
- source
- time
- B

and a class B:

Class B:
- ID (primary key)
- version


I would like to map A to B (the B field in A) by using both ID and version as a foreign key. Note that other classes use B.ID as a simple foreign key.

I can't solve this, I may be too unskilled with databases... I am not using annotations.

Any help to solve this mapping would be greatly appreciated...

thanks!


Karim, Tokyo


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 13, 2008 11:10 am 
Newbie

Joined: Wed May 21, 2008 6:57 am
Posts: 8
i suggest that you put additional field in A which will keep the latest version of B. i don't know if you'll be satisfied with that but it'll do the job


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

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.