c4k*_*c4k 11 inheritance joined-subclass ebean playframework-2.0
经过对谷歌的一些研究,我没有找到任何有我问题的人,这就是我在这里发布的原因.在我的应用程序中,我有三个实体:用户(摘要),客户,代理商.客户和代理商扩展用户.这是用户的代码:
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class User extends AbstractModel {
@Column(unique = true)
@NotNull
@Email
public String email;
@NotNull
public String password;
}
Run Code Online (Sandbox Code Playgroud)
问题是生成的模式只创建一个包含User,Customer和Agency字段的表,这通常是InheritanceType.SINGLE_TABLE(默认)的行为.
使用Ebean和@Inheritance注释有什么问题吗?我尝试了InheritanceType.TABLE_PER_CLASS,它也没有用.我从来没有使用JPA这个问题.有人可以帮忙吗?
非常感谢 ;)