Drakiula
unread,May 25, 2009, 5:29:50 AM5/25/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhusers
Hi, 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 for your answer,
Dragos