pat*_*029 4 java hibernate jpa-2.0
我有两个实体,当我使用@ManyToOne注释时,我收到一个错误说"Target Entity is not defined".
我只是按照教程,我似乎无法找到我做错了什么.
@Entity
@Table(name="BEO_TABLE")
public class BeoBean {
@Id
@GeneratedValue
@Column(name="Beo_Id")
private int beoId;
//other variables
@OneToMany(mappedBy="beo")
private List<EventsBean> listOfEvents = new ArrayList<EventsBean>();
//getters and setters
}
Run Code Online (Sandbox Code Playgroud)
和
@Entity
@Table(name="EVENTS_TABLE")
public class EventsBean {
//other variables
@ManyToOne //error here
@JoinColumn(name="Beo_Id")
private BeoBean beo;
//getters and setters
}
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助
此错误与您的应用程序无关.它工作正常,但错误是在Eclipse中.
要删除此(和其他JPA)错误消息,只需禁用JPA验证,Window -> Preferences -> Validation然后从中删除检查JPA Validator.
一般来说,大多数应用程序都可以在没有任何验证器的情况下开发,因为更大的项目验证会使eclipse中的编译过于缓慢.在这种情况下,请单击Disable all验证器表下方的同一窗口.
| 归档时间: |
|
| 查看次数: |
8274 次 |
| 最近记录: |