Why is it "by definition a 1:1 relationship"?
I do a better job of explaining the issue here: http://community.codesmithtools.com/forums/thread/8568.aspx But to save you the click here is my post from that thread.
--Cut--
In a foreign key relationship a column of the Child table is the foreign key to the primary key in the Parent table.
Usually a foreign key relationship dictates a 1-to-Many relationship. ( One primary key in the parent table has Many children in the child table )
I expect .nettiers to generate the ParentTable.ChildTableCollection property to facilitate the Parent-Child foreign key relationship.
HOWEVER the ParentTable.ChildTableCollection will only get generated if the Child table foreign key column is NOT part of the child table primary key. If is IS part of the child table primary key I only get a ParentTable.ChildTable property generated ... which would indicate it is assuming a 1-to-1 relationship ... which I don't think is correct.
To put in real table terms:
the Student table has StudentId as the key ...
the StudentSubject table has StudentId and SubjectId as the primary key ...
StudentSubject.StudentId is a ForeignKey to Student.StudentId
In this example the generated Student class only has Student.StudentSubject NOT a Student.StudentSubjectCollection. If a remove the primary key from the StudentSubjectTable the generated Student class WILL have a Student.StudentSubjectCollection.
Is this the expected behaviour (and if so why)? A Bug? Or is my DB design / Foreign Key design flawed?
--Cut--