I'm working on evaluating the nhibernate against our legacy database and I ran into an issue where one table has 3 entities represent in it. I wondering if it is possible to model this type of storage.
For example consider the following
Table layout
RowID, Organization ID, Year ID, Line of Business, Unit, Department
1, 1234, 2, Services, Sales, Direct
1, 1234, 2, Services, Sales, Dealer
1, 1234, 2, Services, Consulting, SMB
1, 1234, 2, Services, Consulting, Enterprise
1, 1234, 2, Corp, Finical , AP
The entities and relationship would be
Organization (1) -> (1...*) Line of Business -> Unit (1...*) -> Department (1...*)
I'm thinking that I should create a new object and components for Line of Business, Unit, and department but I'm unsure how to the mapping to tell nhibernate to build the collections or the tree structure.
Any thoughts?
|