I am working off an existing schema with discriminator.
I have the following hierarchy: concrete class with table, abstract class with a couple of attributes (no table) and multiple subclasses each with their own table where the attributes of the abstract class are mapped and the primary key points to the primary key of the first concrete class.
In a 'picture' :
class 1 / table 1
^
|
|
Abstract Class
^ ^
| |
| |
ConcreteA ConcreteB
TableA TableB
Since I need the discriminator I decided to map A and B as subclasses with a joined table. However, I get an error that the columns defined in the abstract class are not mapped. They are mapped to tableA and B respectively, but I am guessing that hibernate expects them to be mapped to table 1 ? Is there a way around this? I couldn't use joined-subclass or union-subclass because that scheme doesn't allow for a discriminator. Help is appreciated.
(the error I am getting is that column phys_inchassis_oid doesn't exist and a print-out of the table 1 columns)
Also a snippet from my hbm.xml files:
Abstract Class:
<hibernate-mapping>
<subclass name="com.hp.ov.persist.shareddb.PhysicalComponent"
abstract="true"
extends="com.hp.ov.persist.shareddb.ConfigurationItem"
discriminator-value="220011775602898267">
<many-to-one name="inChassis" not-null="false" column="phys_inchassis_oid" />
<property name="index" not-null="false" column="phys_index" type="integer" />
</subclass>
</hibernate-mapping>
And a snippet from concrete A:
<subclass name="Port"
extends="PhysicalComponent"
discriminator-value="209862782522863752">
<join table="NPC_PORTS">
<key column="port_cit_p_oid" />
<property name="rcStatBridgeInDiscards" not-null="false" column="port_rcstatbridgeindiscards" type="float" />
|