-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problem with subclasses in 2.0.3
PostPosted: Fri Aug 29, 2003 10:16 am 
Newbie

Joined: Fri Aug 29, 2003 10:08 am
Posts: 1
I'm upgrading from 2.0.1 to 2.0.3 and some of my mappings have stopped working. I have several places where I use lookup tables to map to state objects, which use the primary key as the discriminator. Here is an example:

Code:
<hibernate-mapping>
   <class name="com.bbh.merlin.persistence.failedjob.ReviewStatusState" table="REVIEW_STATUS_TYPE" discriminator-value="null" mutable="false" >
      <id column="REVIEWSTATUSTYPE_ID" name="id" type="long">
         <generator class="assigned"/>
      </id>
      <discriminator column="REVIEWSTATUSTYPE_ID" type="int"/>
      <property column="DESCRIPTION" length="50" name="description" type="string"/>
      <subclass name="com.bbh.merlin.persistence.failedjob.ReviewOpenState" discriminator-value="1"/>
      <subclass name="com.bbh.merlin.persistence.failedjob.ReviewResolvedState" discriminator-value="2"/>
      <subclass name="com.bbh.merlin.persistence.failedjob.ReviewPendingAppealState" discriminator-value="3"/>
      <subclass name="com.bbh.merlin.persistence.failedjob.ReviewPendingRcscState" discriminator-value="4"/>
   </class>
</hibernate-mapping>


This worked fine in 2.0.3, but now I get a mapping exception saying "Repeated column in mapping for class x". It looks like it wants the discriminator to be set to insert="false" update="false", but I can't figure out how to do this when the discriminator is also the ID.

Any ideas?

Mark


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 29, 2003 3:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
urrrgh. this is no longer supported. actually, even in 2.0.1, it wouldn't work on most dbs (you were just lucky before).


perhaps you'd like to look into supporting insert="false" for the discriminator column (update="false" is not necessary, since discriminators are never updated).


have a look in


net.sf.hibernate.persister.EntityPersister



(in the huge 'orrible constructor)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.