-->
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.  [ 3 posts ] 
Author Message
 Post subject: Discriminator question
PostPosted: Mon Jan 15, 2007 12:46 pm 
Newbie

Joined: Fri Dec 29, 2006 1:06 pm
Posts: 3
Location: US
I'm declaring a property as a discriminator the value never changes in the DB when persisting either the parent class or the sub class.

When I persist the subclass (ForumDTO), I have the isForum property set to true. But Hibernate inserts the record with that column set to false.

What am I missing?

Thanks in advance.

Hibernate version:
3.2

Mapping documents:
Code:
<hibernate-mapping>

    <class name="ChannelDTO" table="channel">
        <id name="channelID" column="channelID">
            <generator class="native"/>
        </id>
       
        <discriminator column="isForum" type="boolean" />
      
       
        <property name="title"/>

       <subclass name="ForumDTO" >
        <property name="date"/>
           
            
       </subclass>      
    </class>

</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 1:00 pm 
Newbie

Joined: Fri Dec 29, 2006 1:06 pm
Posts: 3
Location: US
Sorry,

Overlooked a previous posting that made me realize I forgot an attribute on the subclass element in the mapping.


<subclass name="ForumDTO" discriminator-value="true" >
</subclass>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 2:40 pm 
Senior
Senior

Joined: Mon Oct 23, 2006 5:12 am
Posts: 141
Location: Galicia, Spain
Quote:
the isForum property set to true


What "isForum" property? Please post your POJOs and complete mapping files...

_________________
andresgr (--don't forget to rate)


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

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.