我得到了这个sql查询,它返回count
头等舱:
public class Niveau2 implements Serializable{
@Id
@GeneratedValue
private int id2emeniveau;
private int ok;
private int next;
private Date date;
@ManyToOne
@JoinColumn(name = "idzebra")
private Zebra zebra;
二等舱:
public class Zebra implements Serializable {
@Id
@GeneratedValue
private Integer idzebra;
private String type;
private int resolution;
private int reseau;
private String adresseip;
private String snum;
private Date dateaqui;
private Integer affectter;
private int etat;
private String poste, ligne, zone, pole;
@OneToMany(mappedBy = "zebra")
private List<Niveau2> niveau2;
sql语句:
SELECT COUNT(ok) FROM mydb.2emeniveau
INNER JOIN mydb.zebra ON zebra.idzebra=2emeniveau.idzebra
WHERE 2emeniveau.ok='0' AND zebra.pole='ADT'"
我想把它转换成jpql
1条答案
按热度按时间oymdgrw71#
试试这个: