Parent Child Relationships with Fluent NHibernate?

Posted by ElHaix on Stack Overflow See other posts from Stack Overflow or by ElHaix
Published on 2010-12-20T19:12:40Z Indexed on 2010/12/21 10:54 UTC
Read the original article Hit count: 300

I would like to create a cascading tree/list of N number of children for a given parent, where a child can also become a parent.

Given the following data structure:

CountryType=1; ColorType=3; StateType=5
6,7,8 = {Can, US, Mex}
10, 11, 12 = {Red, White, Blue}
20,21,22= {California, Florida, Alberta}

TreeID  ListTypeID  ParentTreeID           ListItemID   
1            1       Null                   6   (Canada is a Country)
2            1       Null                   7   (US is a Country)
3            1       Null                   8   (Mexico is a Country)
4            3       3                      10  (Mexico has Red)
5            3       3                      11  (Mexico has White)
6            5       1                      22  (Alberta is in Canada)
7            5       7                      20  (California is in US)
8            5       7                      21  (Florida is in US)
9            3       6                     10  (Alberta is Red)
10           3       6                    12  (Alberta is Blue)
11          3       2                      10  (US is Red)
12          3       2                      11  (Us is Blue)

How would this be represented in Fluent NHibernate classes?

Some direction would be appreciated.

Thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about fluent-nhibernate