我有4个课程如下...
@MappedSuperclass
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public abstract class Platform{
@Id
@Column(name = "PLATFORM_ID")
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer platformId;
...
@Entity
@Table(name = "ANDROID_PLATFORM")
public class AndroidPlatform extends Platform{
public AndroidPlatform(){
}
...
@MappedSuperclass
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public abstract class Application{
@Id
@Column(name = "APPLICATION_ID")
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer applicationId;
@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name="PLATFORM_ID")
private Platform platform;
...
@Entity
@Table(name = "ANDROID_APPLICATION")
public class AndroidApplication extends Application {
public AndroidApplication(){
}
...
当我开始我的项目时,它会引发这样的错误
org.hibernate.AnnotationException: @OneToOne or @ManyToOne on com.***.model.AndroidApplication.platform references an unknown entity: com.***.model.Platform
...
我的课程有什么问题,或者在 hibernate 中使用抽象类的最佳方法是什么?
请帮忙。