-->
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 help Required - many-to-many mappings
PostPosted: Mon Sep 11, 2006 4:45 am 
Newbie

Joined: Wed Jun 28, 2006 6:34 am
Posts: 11
How would I do the following mapping?

I have two objects - a Company object which holds details of commercial companies and an Instrument object which holds details of financial instruments (equities and bonds) issued by companies. I have an association where a Company can issues one or more Instruments, and an Instrument can only ever belong to one Company.

On the database side the strcuture is more complex as I'm using legacy data structures. There is a many-to-many table between Companies and Instruments (lets call it company_instruments). In practice an Instrument can only ever be associated with one Company, although the data structure allows for multiple associations. There is currently client level code in old applications which means that the many-to-many table only ever lets an Instrument associate with one Company.

To get the hbm.xml mapping files I'm assuming I need to put some kind of association in the Company file, however I'm not sure how to do this with the additional many-to-many table in the way.

Any help appreacited.

Eric


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.