-->
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: "Table per class hierarchy" mapping problem
PostPosted: Sat Oct 11, 2008 10:12 am 
Newbie

Joined: Sat Oct 11, 2008 9:55 am
Posts: 1
Hi, All

I have next hierarchy of classes:

ParameterGenBo (POJO object)
^
Parameter
^
ParameterWithData
^
SicParameter

I want to use "Table per class hierarchy" mapping. But for me this type of mapping is not working: instead of "SicParameter" I am getting object with "Parameter" class (I am checking by ID that correct db-record readed; also descriminator-valeue is set to "Sic").

mapping file for Parameter (Parameter.hbm.xml) is

Code:
<hibernate-mapping>
    <class name="*****.Parameter" table="parameter">
        <id name="id" type="int">
            <column name="id" />
            <generator class="assigned" />
        </id>
       
       <discriminator column="shortname"/>

        <property name="fullname" type="string">
            <column name="fullname" length="64" not-null="true" />
        </property>

   .....
       
        <subclass name="*****.SicParameter" discriminator-value="Sic"/>

    </class>
</hibernate-mapping>



Hibernate version is 3.3.1GA

Name and version of the database you are using:MSSQL 2008


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.