-->
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: Having Bag Elements for joined tables with mutli-column
PostPosted: Mon Jul 30, 2007 5:52 pm 
Newbie

Joined: Mon Jul 30, 2007 5:42 pm
Posts: 1
Location: Arizona
Greetings,

I am trying to figure out a way to have non lazy-loaded collection for a table that would be joined using multiple columns from the parent table. Unfortunately I am dealing with legacy systems that do not have atypical unique identifiers, they use multiple columns instead.
For example

ParentTable
Key1 : string (25)
Key2 : string (25)
ValueData1: string (200)
ValueData2: string (200)

ChildTable
Key1: string (20)
Key2: string (45)
FKey1: string(25) <!-- FOREIGN KEY FIELD 1 -->
FKey2: string(25) <!-- FOREIGN KEY FIELD 2 -->
ValueData554: string (2)

What I don't understand is how to identify in the hbm files the relationship between ParentTable and ChildTable. Obviously this doesn't work:

<bag name="Invns" cascade="none" lazy="false" >
<key column="FKey1" />
<key column="FKey2" />
<one-to-many class="Dao.ChildTableClass, Me.Dao" not-found="ignore" />
</bag>


System = NHibernate 1.2.0 Legacy Teradata Database


Has anybody dealt with this and is it even possible? I think the where attribute might help, but I don't want to hard-code the join. In some cases I would even need to do this auto-join with columns that are not the primary key.

_________________
Michael McCurrey
http://www.mccurrey.com


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.