0
我需要一些幫助。Sintaxis JQPL篩選器列表
我有這樣的兩個表
public class Publication implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "idPublication")
private Integer idPublication;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "publication")
private List<Question> questionList;
....
}
塔布拉問題
public class Question implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "idQuestion")
private Integer idQuestion;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 500)
@Column(name = "pregunta")
private String question;
@JoinColumn(name = "publication", referencedColumnName = "idPublication")
@ManyToOne(optional = false)
private Publication publication;
@NotNull
private Boolean activo;
....
}
我需要與誰擁有活躍的問題=真正的出版物。 例如:我有出版物A和出版物B,其中A有5個問題,2個有效,B有6個問題,有5個有效。
我嘗試做「選擇從出版物P,問闕p其中p.idPublication = que.publication.idPublication和que.activo = 1」,但它返回與他們的所有問題發表...
我不能FINDE解決這個
請幫助
電賀