Hi all.
I'm using NHibernate 1.2 GA, but am willing to go to a more recent build if necessary.
I have the following table structure in a legacy database I'm trying to map...
Table: TextInstruction
Composite key:
ID-Revision-Sequence
Table: TextInstructionLine
Composite key:
ID-Revision-Sequence
Now, these ID-Revision-Sequences are not the same. Basically, when a user starts a job, they can have multiple instructions. Each instruction has an ID and Rev, and for a specific job they might have more than one instruction, whose order is represented by the sequence. These are the keys for TextInstruction.
TextInstructionLine contains the actual lines that make up the text. The sequence is the line number. Please, hold your laughter.
So, basically, one Instruction (table not shown) can have multiple TextInstructions in a sequence, each having multiple lines.
Ok, if the TextInstructionLine was properly set up and had the foreign keys for the TextInstruction, I'd be golden, but instead, the TextInstruction table has LineID and LineRev columns, which is used to find all the lines, and order them by the sequence.
So, in other words, the containing table holds the foreign keys, and due to the fact that the key is composite but the table doesn't store everything, it's not even the complete key at that.
Any ideas how I can go about this so I can still have an IList<string> or IList<TextInstructionLine> in my TextInstruction domain class? I have an alternate plan to keep them seperate and do all the creating in the task layer, which would be a pain, but at least something if no one else has any ideas...
Thanks in advanced.
|