Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
I have an object heirarchy with a table per object where each subclass has a different name for the key.
Object (id column is org_id)
Organization (id column is org_id)
GovernmentOrg (id column is gov_id)
MilitaryOrg (id column is mil_org_id)
I would like to map this using join-subclass syntax, but am not sure if there is a way to specify that the id column is named differently for the subclasses. So for the military org, its id would be in the parent tables, just in differently named columns. Thanks in advance.
Hibernate version: 3.0rc1
Mapping documents:
Code:
<class name="Object" table="objects">
<id name="objId" column="obj_id"/>
<join-subclass name="Organization" table="organizations">
<!--what should this be to map to org_id ??? -->
<key column="obj_id"/>
<property name="orgName" column="org_name"/>
...
<join-subclass name="GovOrg" table="government_orgs">
<!--what should this be to map to gov_id ???-->
<key column="obj_id"/>
<property name="governmentBranch" column="gov_branch"/>
...
<join-subclass name="MilitaryOrg" table="military_orgs">
<!--what should this be to map to mil_id ???-->
<key column="obj_id"/>
</join-subclass>
</join-subclass>
</join-subclass>
<class>