Thanks for quick response.
Let my explain in details what kind of mappings I need.
We have composed hierarchy of objects with common base abstract class
- BusinessObject. Until now we have whole hierarchy mapped by <joined-
subclass>. But becouse of performance reasons and specificity of
realized queries we want to horizontally divide base table of our
hierarchy into a few distinct tables: TABLE1, TABLE2, TABLE3.
The idea is following:
For every new distinct tables should be prepared new classes:
Class1Marker, Class2Marker, Class3Marker derivated from BusinessObject
class.
Class1Marker, Class2Marker and Class3Marker classes are mapped by
<union-subcless>.
In this way, we will have SHALLOW hierarchy of object derivated from
BusinessObject class (stored in several tables: TABLE1, TABLE2,
TABLE3).
This hierarchy is sufficient for most of required and frequently
executed queries and will be used for read only.
But any of Class1Marker, Class2Marker, Class3Marker classes does not
represent concrete object.
So we want to prepare additional distinct hierarhies beased of a
tables TABLE1, TABLE2, TABLE3. For each table separated hierarchy may
used different inheritance strategy (mixing table per class hierarchy
with table per subclass). To do this we need to prepare another
mappings for tables TABLE1, TABLE2, TABLE3 and classes Class1, Class2,
Class3 (not marker).
Everything works fine untill mappings of BusinessObject and
Class1Marker, Class2Marker, Class3Marker classes are placed before
other mapping for tables TABLE1, TABLE2, TABLE3.
> 2009/2/20 Piotr Jakóbczyk <
piotr.jakobc...@gmail.com>
>
>
>
>
>
> > 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 <
fabioma...@gmail.com> 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
--
Piotr Jakóbczyk