ID LABEL P_ID
1 A null
2 AB 1
3 ABC 2
SELECT * FROM ACT
JOIN ORG DEPT ON ACT.ORGID = DEPT.ID
JOIN ORG DEPT2 ON DEPT.P_ID = DEPT2.ID
WHERE DEPT.P_ID = 123
query.join(act.org, dept).on(act.org.id.eq(dept.id)).where(dept.org.parent.eq(123));
O DEBUG JPAQuery-从Dossier dossier_left join dossier_.acties action_inner join action_.organizatiestructuur organizatiestructuur_on action_.organizatiestructuur.id=organizatiestructuur_.id where dossier_.deleted=?1而organizatiestructuur_.ouder=?2
ArgumentException:“在字符64处”遇到“,但应为:[”,“,”group“,”having“,”inner“,”join“,”left“,”order“,”where“,].”解析JPQL时,“从Dossier dossier_left join dossier_.acties action_inner join action_.organistieStructuur organistieStructuur on action_.organistieStructuur.id=organistieStructuur.id where dossier_.deleted=?1和organistieStructuur.ouder=?2”。
[添加9-feb:]域模型(只显示包含字段的第一部分,其他getter/setter方法由于大小而未显示):
@Entity
public class Dossier extends AbstractEntity implements Serializable, HasCommunicaties {
private static final String SHAREPOINT_NR_FORMAT = "{0,number,0000}/{1,number,00}";
@Version
private long version;
private int jaar;
private int volgNummer;
private Status status;
public enum Status {
OPEN, AFGESLOTEN;
}
@Temporal(TemporalType.TIMESTAMP)
private Date datumStatus;
@NotNull
@Column(length = 5000)
@Size(max = 5000)
private String beschrijvingVaststelling;
@Column(length = 5000)
@Size(max = 5000)
private String oorzaakVaststelling;
@ManyToOne
private ZorgDomein zorgDomein;
@ManyToOne(fetch = FetchType.LAZY)
@NotNull
private Bron bron;
@ManyToOne
private KernWaarde kernWaarde;
private String pdca;
@Valid
@OneToMany(mappedBy = "dossier", cascade = CascadeType.ALL, orphanRemoval = true)
@Size(min = 1)
private List<PlaatsVaststelling> plaatsVaststellingen = new ArrayList<PlaatsVaststelling>();
@ManyToOne(fetch = FetchType.LAZY)
private Proces proces;
@NotNull
private String beheerder;
@Temporal(TemporalType.DATE)
@Past
private Date datumVaststelling;
@ManyToOne(fetch = FetchType.LAZY)
private TypeVaststelling typeVaststelling;
@ManyToOne(fetch = FetchType.LAZY)
private Prioritering prioritering;
@ManyToOne(fetch = FetchType.LAZY)
private AuditRapport auditRapport;
@OneToMany(mappedBy = "dossier", cascade = CascadeType.ALL)
@OrderBy("volgnummer")
@Valid
private List<Actie> acties = new ArrayList<Actie>();
@OneToMany(mappedBy = "dossier")
@OrderBy("datum desc")
private List<Communicatie> communicaties = new ArrayList<Communicatie>();
@OneToMany(mappedBy = "dossier", cascade = CascadeType.ALL)
@OrderBy("datum desc")
private List<Historiek> historieks = new ArrayList<Historiek>();
private boolean vertrouwelijk;
@ElementCollection
private List<String> beheerders = new ArrayList<String>();
@ElementCollection
private List<String> lezers = new ArrayList<String>();
private boolean mailPVAVerstuurd;
private Date datumAanpakTegen;
private boolean deleted;
此SQL
SELECT * FROM ACT
JOIN ORG DEPT ON ACT.ORGID = DEPT.ID
JOIN ORG DEPT2 ON DEPT.P_ID = DEPT2.ID
WHERE DEPT.P_ID = 123
可以通过
QAct act = QAct.act;
QOrg dept = new QOrg("dept");
QOrg dept2 = new QOrg("dept2");
query.from(act)
.join(act.org, dept)
.join(dept.p, dept2)
.where(dept2.p.id.eq(123))
.list(act);
我不确定如何将SQL映射到您的域模型,这就是为什么我使用了与SQL关系相近的实体名称。
我有一个带有QueryDSL JPAQuery的应用程序。这里是: 我已经尝试了DeviceGroup.Customer.Account而不是WorkGroup.Account,结果是一样的。 以下是jpaQuery.toString():
Generating Warnings # warnings_warn.py import warnings print('Before the warning') warnings.warn('This is a warning message') print('After the warning') # warnings_warn_raise.py import warnings war
我需要为分页的目的计算group by记录的数量。例如: 但由于JPA的限制,JPQL不允许从子查询中选择计数,因此无法通过QueryDSL实现。 是否可以从QueryDSL、JPAQuery或JPQLQuery获取本机SQL?我的计划是通过EntityManager构造并执行select count本机SQL语句。
连接失败:SQLState[28000][1045]拒绝用户“rkcat”@"localhost“(使用密码:YES)的访问。严重错误:对中的非对象调用成员函数query()
所以我试图克隆一个git存储库,但它不断抛出一个关于身份验证失败的错误。 错误如下: 我已经检查了我的配置,存储库的用户名和密码是正确的,但不知何故克隆无法工作。 关于我现在能做什么的任何提示?
我尝试了一些代码来使用PHP和slim框架构建RESTful API Web服务。(我正在使用高级Rest客户端测试此代码) 这是我的密码。