我正在休眠状态下在hibernate中使用Joined表继承。
@Entity
@Table(name = "LIVING_THING")
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class Living implements Serializable {
}
@Entity
@Table(name = "PERSON")
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class Person extends Living{
}
@Entity
@Table(name = "EMPLOYEE")
public abstract class Employee extends Person {
}
and Person is again extended by another class Student:
@Entity
@Table(name = "STUDENTS")
public abstract class Student extends Person {
}
现在,一个人可以是雇员,也可以是一个人,但是在两个具体表中的任何一个表中都没有任何条目的情况下,该人是否存在?如果不是,那么我应该采取什么其他方法,以便一个人可以不作为学生或雇员而存在,也可以使他成为雇员和学生?