I have the following EJB Entity:
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@Table(name="USERS")
@SecondaryTable(name="GROUPS", join={@JoinColumn(name="USERNAME", referencedColumnName="USERNAME")})
public abstract class User implements Serializable {
private String userName, group;
public User() {
userName = new String();
group = new String();
}
@Id
@Column(name="USER")
public String getUserName() {
return this.userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
@Column(name="GROUPNAME", secondaryTable="GROUPS")
public String getGroup() {
return this.group;
}
public void setGroup(String group) {
this.group = group;
}
}
For some reason, I get the following exception, The table does indeed exist.
[org.hibernate.AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: table not found
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:444)
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:225)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
...
...
Any help would be much appreciated!
Thanks,
~K