-->
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 Question
PostPosted: Sun Jul 02, 2006 11:14 am 
Newbie

Joined: Sun Jul 02, 2006 10:35 am
Posts: 1
Hi,

I need some help in mapping two Objects A & B described below along with their Tables. There is a one-to-many relationship between Object A and Object B. But I want to do a one-to-one mapping between these two objects (A combination of "aId" & "bId" makes it one-to-one). Can some one tell me how to map these two objects so that whenever I read Object A I get unique values of Object B (using "aId" & "bId" as key) into bId, bField3, bField4 of Object A?

Code:
ObjectA{
  Long aId;
  String aField2;
  String aField3;

  Long bId;
  String bField3;
  String bField4;
}

ObjectB{
  Long bId;
  Long aId;
  String bField3;
  String bField4;
}


TABLE_A
-----------
A_ID
COL2
COL3

TABLE_B
----------
A_ID
B_ID
COL3
COL4


Thanks

_________________
Praveen


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.