The pattern name is table-per-class that mean each class (no matter if
abstract) is represented in one table.The others two ORM patterns are:
- table-per-class-hierarchy (one table for the whole hierarchy)
- table-per-concrete-class (one table per each concrete class with all
properties of its hierarchy)

In Hibernate we have one more pattern to allow a mix between table-per-class
and table-per-class-hierarchy.

Resuming :
1) table-per-class: <joined-subclass>
2) table-per-class-hierarchy: <subclass>
3) table-per-concrete-class: <union-subclass> (or <class>)
4) Mix table-per-class-hierarchy and table-per-class: <subclass>+<join>

What you are doing is simply not supported and the pattern does not have a
name.

The use of <class>+<join> is only for some special case for legacy-db, or
another way to represent a one-to-one, or a NH specific trick used only
because we still haven't field interception.

Answer:
You can mix <joined-subclass> with <join>

2009/6/6 dke01 <[email protected]>

>
> I am doing "table per subclass" Inheritance with 1 parent and 2
> subclasses, I also have a related table called Address which links to
> Party (the parent)
>
> The XML mapping file will not allow me to use both join table and
> joined-subclass for my Company and Individual. When I try to include
> my address into Party via join. Is there any way around this? (p.s I
> am only new to nHiberbate)
>
> <class name="Party"
> abstract="true"
> table="Parties">
> <id name="Id">
> <generator class="identity"/>
> </id>
> <property name="EntityName" column="entity_name"/>
> <property name="ShortName" column="short_name"/>
>
> <join table="logical_address">
> <key column="address_id"/>
> <component name="ContactDetails" class="ContactDetails">
> <property name="EmailAddress" column="email_address"/>
> <property name="HomePhone" column="home_phone_number"/>
> </component>
> </join>
>
>
> <joined-subclass table="individual" name="Individual">
> <key column="party_key"/>
>
> >
>


-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to