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 .