2
我試圖將類層次結構映射到使用休眠和一個表不創建。我添加@Inheritance(戰略= InheritanceType.SINGLE_TABLE),但在基地有單獨的表。SIngle表戰略不工作休眠
@MappedSuperclass
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public abstract class User implements UserDetails {
@Id @GeneratedValue
private int id;
...
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
...
}
@Entity
public class Manager extends User{
...
}
@Entity
public class Administrator extends User{
...
}
怎麼了?
謝謝,它的工作 –