tenwit wrote:
Well, there's no way around it: querying for all Headers will give you all matching Headers, no matter what class. You'll have to redesign something. I suggest putting links from clients to both Headers and AssignedHeaders. You don't have to do this in the schema, it sounds like you have all the necessary columns already. You just have to add some bidirectional mappings.
Can show me how to add bi-directional mapping from super to sub class and subclass to super for my mapping .At least an example will do.
Do i have to define many to one relationship from the subclass?. i did that
and it did not make a difference.Can please correct my mapping?.
<hibernate-mapping>
<class name="Header" table="MENU_HEADER_DEFINITION">
<composite-id
name="DefKey"
class="BaseOID"
unsaved-value="none">
<key-property name="ID" type="int" >
<column name="MENU_HEADER_DEFINITION_ID" sql-type="int" not-null="true" />
</key-property>
<key-property name="OrigID" type="int" >
<column name="MENU_HEADER_DEFINITION_ORIG_ID" sql-type="int" not-null="true" />
</key-property>
</composite-id>
<version
column="INSTANCE_VERSION_NUMBER"
name="instanceVersionNumber"
/>
<property name="labelIdentifier">
<column name="MENU_LABEL_MESSAGE_IDENTIFIER" sql-type="string" not-null="true" />
</property>
<property name="DisplaySeqNum">
<column name="DISPLAY_ORDER_SEQUENCE_NUMBER" sql-type="int" not-null="true" />
</property>
<property name="ExpandsByDefault">
<column name="EXPANDS_BY_DEFAULT_FLAG" sql-type="string" not-null="true" />
</property>
<property name="lastModifiedTS">
<column name="LAST_MODIFIED_TS" sql-type="date" not-null="true" />
</property>
<joined-subclass name="AssignedHeader"table="CONNECT_OWNER.MENU_HEADER_ASSIGNMENT">
<key>
<column name="MENU_HEADER_DEFINITION_ID" not-null="true" />
<column name="MENU_HEADER_DEFINITION_ORIG_ID" not-null="true"/>
</key>
....
...