-->
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: collection mapping using composite key
PostPosted: Thu Jul 18, 2013 10:09 am 
Newbie

Joined: Thu Jul 18, 2013 5:33 am
Posts: 4
Our requirement is to perform ETL from Staging to Working tables

OrderStg and ItemStg are two tables in staging side which doesnt have any DB constraints. No foreign keys.
Transform logic establishes the relation and puts it to Working tables (this has Foreign keys).

OrderStg --> ItemStg is a one to many relation.
Three of the fields in OrderStg constitutes composite key. Those records in ItemStg having these 3 field values should be marked as child of OrderStg.

How should the mapping be? Any pointers?

I am using composite-id but I am not getting one-to-many mapping right using set.


Top
 Profile  
 
 Post subject: Re: collection mapping using composite key
PostPosted: Mon Jul 29, 2013 12:54 am 
Newbie

Joined: Thu Jul 18, 2013 5:33 am
Posts: 4
So the table structure would be like the following

Code:
Order                       Item
=====                     ==== 
OrderId (PK)             ItemId(PK)
Source                   Source
Version                 Version
OrderNumber              OrderNumber
                        ItemNumber     


There is no FK between tables, although Source,Version,OrderNumber together is used to associate Item to an Order

Thanks


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.