Eclipse Hibernate 3.2.6/JPA:In属性';X';,";映射为;属性';Y';此关系的映射类型无效
我有这门课Eclipse Hibernate 3.2.6/JPA:In属性';X';,";映射为;属性';Y';此关系的映射类型无效,eclipse,jpa,Eclipse,Jpa,我有这门课 @SuppressWarnings("serial") @Entity @Table(name = "T_APPLICATION") @SequenceGenerator(name = "seqAPPLICATION", sequenceName = "SEQ_APPLICATION", allocationSize = 1) public class Application implements java.io.Serializable { private Set<
@SuppressWarnings("serial")
@Entity
@Table(name = "T_APPLICATION")
@SequenceGenerator(name = "seqAPPLICATION", sequenceName = "SEQ_APPLICATION", allocationSize = 1)
public class Application implements java.io.Serializable {
private Set<Service> services = new HashSet<Service>(0);
@OneToMany (fetch = FetchType.LAZY, mappedBy = "application", cascade = { CascadeType.REMOVE })
@Cascade({ org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
@OrderBy("id")
public Set<Service> getServices() {
return this.services;
}
..
}
但是在我的Eclipse版本:Mars.2(4.5.2)编辑器中,我有这个错误
在属性“服务”中,“映射者”属性“应用程序”具有无效的
此关系的映射类型。
刷新和清理我的项目没有帮助
这是我的JPA eclipse验证器
Eclipse不必要地抱怨。hibernate应该可以正常工作。尝试刷新项目并更新persistence.xml中的类列表。看看这个,我没有在persistence.xml中定义任何类,这是哪个版本的Eclipse,只是为了完整性?
@SuppressWarnings("serial")
@Entity
@Table(name = "T_SERVICE")
@SequenceGenerator(name = "seqSERVICE", sequenceName = "SEQ_SERVICE")
public class Service extends ItemBase implements java.io.Serializable {
private Application application;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "APPLICATION", nullable = false)
public Application getApplication() {
return this.application;
}
public void setApplication(Application application) {
this.application = application;
}
..
}