Your mapping is wrong...You should define the ClassB inside the <union-subclass> node and no out-side as an independent class. one example from our tests (for simplicity) <class name="Being" abstract="true">
<id name="id"> <generator class="hilo"/> </id> <union-subclass name="Human" table="humans"> <property name="sex" not-null="true" update="false"/> <union-subclass name="Employee" table="employees"> <property name="salary"/> </union-subclass> </union-subclass> <union-subclass name="Alien" table="aliens"> <property name="species" not-null="true" update="false"/> <many-to-one name="hive" not-null="true"/> </union-subclass> </class> 2009/2/20 Piotr Jakóbczyk <[email protected]> > > I know what union-subclass is and I read references about all > inheritance strategy implemented by NH. > In my example I used <union-subclass> (look at SubclassA entity > mapping). > But why, in my example, the changing of the order of mapping > definitions provide different behevoiur of NH. The first order raises > exception, but the second not. > > On 20 Lut, 13:45, Fabio Maulo <[email protected]> wrote: > > union-subclass is an advanced way provided by NH to implement the mapping > > pattern : table-per-concrete-class > > What you are looking for is the implementation of the pattern : > > table-per-class-hierarchy > > The tag for that is <subclass>; reference available herehttp:// > nhforge.org/doc/nh/en/index.html#mapping-declaration-subclass > > > > -- > > Fabio Maulo > > -- > Piotr Jakóbczyk > > > -- Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" 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/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
