-->
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: org.hibernate.AssertionFailure
PostPosted: Wed Jan 27, 2010 2:26 pm 
Newbie

Joined: Fri Nov 20, 2009 10:41 am
Posts: 3
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;
}

}


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.