我有一个旧的Spring-MVC项目,在发达:Hibernate 4.3.8.Final,JPA version 1.7.2并且Java 7,与老JS组件,我需要重新在这个项目问题Spring-Boot项目(使用Spring5,Java8,Thymeleaf和Bootstrap)。我不能丢失旧的数据库,我不能丢失或更改数据库的结构,所以我正在重写域的类,但我有一个注释错误。这是域类的代码:@OneToMany(mappedBy="order", cascade=CascadeType.REMOVE)@JsonBackReference("job-order")@Where(clause="year = '0'")private List<Job> jobYearI = new ArrayList<>();@OneToMany(mappedBy="order", cascade=CascadeType.REMOVE)@JsonBackReference("job-order")@Where(clause="year = '1'")private List<Job> jobYearII = new ArrayList<>();@OneToMany(mappedBy="order", cascade=CascadeType.REMOVE)@JsonBackReference("job-order")@Where(clause="year = '2'")private List<Job> jobYearIII = new ArrayList<>();我需要根据年份值填充 jobYearX,但在新项目中我有这个错误:import org.hibernate.annotations.Where 无法解析有办法解决吗?提前致谢编辑我的工作班@SuppressWarnings("serial")@Entity@Audited@Table(uniqueConstraints=@UniqueConstraint(columnNames={"order_certification", "year"}))public class Job extends AbstractDomain { @ManyToOne(optional=false) @JoinColumn(nullable=false, updatable=false) @JsonManagedReference("job-orderCertification") private OrderCertification orderCertification; @Enumerated(EnumType.ORDINAL) @Column(nullable=false, name="year", updatable=false) private Year year;
添加回答
举报
0/150
提交
取消