-->
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 attributs of 2 class as a single primary key
PostPosted: Thu Feb 03, 2005 10:34 am 
Newbie

Joined: Wed Feb 02, 2005 11:00 am
Posts: 1
Location: Paris
Hello there,

I have a Table with 4 field F1,F2,F3,F4 (of type NUMBER).
Fields F1,F2,F3 constitute the primary key.

The objet oriented version of this table is represented with the Classes A and B (and B is a component of A).
- Class A hold the attributs int F1,int F2,int F4, B b
- Class B hold the attribut F3

I wasn't able to find a way to express that mapping :

<the-key>
A.F1 -> T.F1
A.F2 -> T.F2
A.B.F3 -> T.F3
</the-key>

<the-data>
A.F4 -> T.F4
</the-data>

I have tried a lot composite-id combinaisons without success.
It work only if I put proper getter and setter for field F3 arround b instance, but it implie modifying my model...

Have an idea ?


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.