Pessoal,
estou estudando JPA com o Hibernate e estou tentando implementar o mapeamento de herança descrito abaixo:
import javax.persistence.*;
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name="pessoa")
public class Pessoa {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(unique=true, nullable=false)
private int id;
@Column(length=45)
private String nome;
public Pessoa() {
}
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public String getNome() {
return this.nome;
}
public void setNome(String nome) {
this.nome = nome;
}
}
@Entity
@Table(name="pessoa_juridica")
public class PessoaJuridica extends Pessoa {
@Column(precision=10, scale=2)
private BigDecimal renda;
public PessoaJuridica() {
}
public BigDecimal getRenda() {
return this.renda;
}
public void setRenda(BigDecimal renda) {
this.renda = renda;
}
}
Porém,
o eclipse está emitindo a seguinte mensagem sobre a annotation @Entity da classe Pesso:
- Discriminator column “DTYPE” cannot be resolved on table
"{1}"
- Discriminator column “DTYPE” cannot be resolved on table
"pessoa"
alguém tem idéia de que erro é esse?