【发布时间】:2014-04-09 12:37:14
【问题描述】:
我有一个 User 类,以及从它继承的三个其他类:Employer、Student 和 Coordinator。这是我的用户类:
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class User extends Model {
@Id
@GeneratedValue
public Long id;
public String username;
public String password;
public static Finder<Long, User> find = new Finder(Long.class, User.class);
public static User authenticate(String username, String password) {
return find.where().eq("username", username).eq("password", password).findUnique();
}
}
但是,Ebean 只创建了一个表 User,将 4 个类中的所有数据组合在一起。如何让 Ebean 创建一张用户表、一张雇主表等?
这就是我在添加@Inheritance 注释时期望Ebean 做的事情。我做错了什么?
【问题讨论】:
标签: playframework playframework-2.2 ebean