JPQL离开了join子句where

时间:2016-05-25 15:21:46

标签: hibernate jpa jpql

我有这两个实体有很多关系, 这是我的转移实体:

@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解决它?

这是我尝试列出类别(一对多方面)时得到的结果: enter image description here

0 个答案:

没有答案