0
votes

I have standard one-to-many table setup, but I want to be able to map it to a class structure that looks like this:

Class 1 -> Mapped to Table 1 (The one- side of the one-to-many relationship)
   |
   --- Intermediary class that has additional methods on and has a List of Class 2
       |
       ---- Class 2 -> Mapped to Table 2 (The -many side of the relationship)

Is this possible with NHibernate?

1

1 Answers

0
votes

it is possible for example

class Class1Map : ClassMap<Class1>
{
    public Class1Map()
    {
        Id(x => x.Id);
        Component(c =>
        {
            c.Map(x => x.Foo);
            c.HasMany(x => x.Classes2);
        });
    }
}