-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Help with hierarchy mapping needed
PostPosted: Mon Jul 31, 2006 8:42 pm 
Newbie

Joined: Fri Jul 14, 2006 10:52 am
Posts: 16
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" />


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.