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
|