我有这两个实体有很多关系, 这是我的转移实体:
@Entity
public class Transfer implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
private String status;
private Task task;
public Transfer() {
}
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@ManyToOne
public Task getTask() {
return task;
}
public void setTask(Task task) {
this.task = task;
}
}
这是Taks Entity:
@Entity
public class Task implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
private String code;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Boolean getIsLast() {
return isLast;
}
public void setIsLast(Boolean isLast) {
this.isLast = isLast;
}
}
现在我想得到他的转让孩子的状态等于某个值的任务,如何用JPQL解决它?