Hello.
I have an inheritance hierarchy like the following:
[code]
<hibernate-mapping>
<class name="es.tid.psstlatam.api.wgw.WGWContent" table="WGWContent">
<id name="id" type="long" unsaved-value="null">
<generator class="sequence">
<param name="sequence">WGWContent_sequence</param>
</generator>
</id>
<discriminator column="discriminator" type="string"/>
<property name="name" />
<property name="description" />
<property name="day" />
<property name="published" />
<property name="priority" />
<!-- Relations to other tables -->
<many-to-one name="site" column="WGWSite_id" class="es.tid.psstlatam.api.wgw.WGWSite" not-null="true" />
<!-- Subclasses in other files -->
</class>
</hibernate-mapping>
[/code]
And the subclasses follow this pattern:
[code]
<hibernate-mapping>
<subclass name="es.tid.psstlatam.api.wgw.WGWBigBanner" extends="es.tid.psstlatam.api.wgw.WGWContent" discriminator-value="BigBanner">
<property name="filename" />
</subclass>
</hibernate-mapping>
[/code]
In this context, do I need a "polymorphic association"? What is it for? Where do I define it? In the superclasse's mapping? In all of the subclasse's mappings?
Thanks, Manuel.
|