Hi...I have a class named Animal wich uses the annotation @SecondaryTable...when I try to deploy it on my server works fine until I put another class to inherit it...when I try it hibernate says: ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=#DataServicePU state=Create org.hibernate.AssertionFailure: Table animal_state not found
this is my code:
@Entity @Table(name="animals") @Inheritance(strategy=InheritanceType.JOINED) @SecondaryTable(name = "animal_state", pkJoinColumns={ @PrimaryKeyJoinColumn(name="animal_id")}) public class Animal extends EntityBean<Integer> {
protected String name; protected Integer temperature; public Animal() {}
@Id @Column(name="animal_id") public int getAnimalId() { return this.beanId.intValue(); }
public void setAnimalId(int id) { this.beanId = id; }
public String getName() { return name; }
public void setName(String name) { this.name = name; }
@Transient public String getEntityKey() { return new Integer(this.beanId).toString(); }
@Transient public String getDisplayValue() { return "Animal"; }
@Column(name="temperature", table = "animal_state",nullable=true) public int getTemperature() { return temperature; }
public void setTemperature(int temperature) { this.temperature = temperature; }
}
//*********************************************THE OTHER CLASS @Entity @Table(name="dogs") @SecondaryTable(name="dog_states", pkJoinColumns={@PrimaryKeyJoinColumn(name="animal_id")}) public class Dog extends Animal {
private String collarColor; private String animo; public Dog() {
}
public String getCollarColor() { return collarColor; }
public void setCollarColor(String collarColor) { this.collarColor = collarColor; }
@Column(name = "animo", table="dog_states",nullable=true) public String getAnimo() { return animo; }
public void setAnimo(String animo) { this.animo = animo; }
}
|