Yes, this is possible, although I'm not sure about combining the discriminator on the base class tables. NHibernate will figure out what your concretes are based on the direction the joins match through the table structure. Nested Joined subclasses are allowed.
On Mon, May 25, 2009 at 7:33 AM, Drakiula <[email protected]> wrote: > > Hi, > > I posted the following to the nhusers group as well, at > > http://groups.google.com/group/nhusers/browse_thread/thread/ab409f999e909106 > > Maybe any of you guys have a definite answer on this: > > I have the following class inheritance hierarchy: > public class A {} > public class B : A {} > public class C : B {} > public class D : B {} > In the database I have tables A, B, C, D where: > - B has a foreign key relationship to A; > - C and D have foreign key relationships to B; > Both foreign key relationships are established using the PK field of > the tables(PK field type is Decimal). > On top of that, both base classes contain a discriminator column that > indicates the inheritor type. > Question: is this mapping scenario possible in NHibernate(table per > subclass, using the mentioned class inheritance hierarchy)? > If the answer is yes, how should the XML mapping file look like? Are > nested <joined-subclass /> elements allowed/supported? > > Thanks in advance, > Dragos > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---
