-->
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: hbm2ddl does not generate discriminator
PostPosted: Mon Dec 03, 2007 8:27 am 
Newbie

Joined: Mon Dec 03, 2007 8:20 am
Posts: 1
Hello,

I have two simple classes:

Code:
import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

@Entity
@Table(name = "base", schema = "public")
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(discriminatorType=DiscriminatorType.STRING, name="dtype")
public class BaseTest implements Serializable {
   private Integer id;

   @Id
   @Column(name = "id", unique = true, nullable = false)
   public Integer getId() {
      return this.id;
   }

   public void setId(Integer id) {
      this.id = id;
   }
}


and

Code:
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

@Entity
@Table(name = "dok", schema = "public")
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorValue(value = "dok")
public class Dok extends BaseTest{
   private Integer dokId;

   @Column(name = "dok_id", unique = true, nullable = false)
   public Integer getDokId() {
      return this.dokId;
   }

   public void setDokId(Integer id) {
      this.dokId = id;
   }
}


When I use hbm2ddl in hibernate.properties, then in DB I can't see column with discriminator. What I'm doing wrong?
I use Hibernate ver. 3.2.5 ga and Annotation ver. 3.3.0
Thanks for any help .


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.