-->
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: Schema not updated when converting Entity to Superclass
PostPosted: Tue Nov 15, 2011 3:05 pm 
Newbie

Joined: Tue Nov 15, 2011 3:01 pm
Posts: 1
I previously had this entity
Code:
@Entity
@Table(name = "SOMETABLE")
@AccessType("field")
public class SomeEntity implements java.io.Serializable {


Then I changed it to this

Code:
@Entity
@Table(name = "SOMETABLE")
@AccessType("field")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "DISCRIMINATOR", discriminatorType = DiscriminatorType.STRING, length = 20)
@DiscriminatorValue(value = "Some")
public class SomeEntity implements java.io.Serializable {


and I added some subclasses

Code:
@Entity
@DiscriminatorValue(value = "SomeOther")
public class SomeOtherEntity extends SomeEntity {


Hibernate does not add a new Discriminator column to SOMETABLE for rows that were previously there.

It is adding other new columns I have defined in SomeEntity. @ForceDiscriminator didn't seem to do anything. How do I get the column to show up in a clean way?


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.