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: How to map with object aggregation in the absense of databas
PostPosted: Fri Oct 20, 2006 10:57 am 
Newbie

Joined: Fri Oct 20, 2006 10:45 am
Posts: 1
Hi,

I want to know how to map aggregated mapping of multiple objects (detils below) in the absense of database-identity key.

(I know hibernate allows in mapping multiple objects to a single row - where there is a primary key)

Aggregation:
1Report --has-- 1..* Company
1Company --has-- 1..* Currency

This is only fetching, no object manipulation required

Thanks
Prem


Data From a View V_REPORT in database:


RPT_DATE COMPANY_CODE CURRENCY_CODE AMT
10/16/2006 111 AUD 939425.79
10/16/2006 111 INR 1293.31
10/17/2006 111 THB 262764.81
10/17/2006 111 USD 280
10/16/2006 222 AUD 234926.45
10/16/2006 222 INR 393.33
10/16/2006 222 THB 65761.2
10/16/2006 222 USD 140
10/17/2006 444 AUD 10
10/17/2006 444 INR 20

I need the following object hierarchy (with appropriate composition):


I need the following object hierarchy (with appropriate composition):
1. Report(RPT_DATE=10/16/2006)
a. Company(CODE=111)
i. Currency(AUD, 939425.79)
ii. Currency(INR, 1293.31)
b. Company(CODE=222)
i. Currency(AUD, 234926.45)
ii. Currency(INR, 393.33)
iii. Currency(THB, 65761.2)
iv. Currency(USD, 140)

2. Report(RPT_DATE=10/17/2006) - similar as above


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.