我有兩個表格,一個用於派對,一個用於記分卡模板映射。記分卡模板映射表具有返回到該方的外鍵(在ID上)。我想查找具有記分卡模板映射詳細信息的所有參與方的列表。執行JPA中的左連接查詢
,但我得到它說的錯誤:
java.lang.IllegalArgumentException異常: org.hibernate.hql.internal.ast.QuerySyntaxException:意外的標記: 近線1,列172選擇新 ScorecardTemplateMapping(p,temMap.scoTemplate,temMap.wrkFlwTemplate) 從com.kpisoft.common.web.domain.Party p左外側上temMap.organization.id = p.id和 temMap.gradeType加入 ScorecardTemplateMapping temMap。 id =:gradeType其中 p.organization.organizationTypeId =:orgType和p.clientId =:客戶端ID 爲了通過p.organization.name]
這是我的查詢:
查詢Q = entityManager.createQuery(「選擇新 ScorecardTemplateMapping(P,temMap.scoTemplate,temMap.wrkFlwTemplate) 甲方p左外連接ScorecardTemplateMapping temMap上 temMap.organization.id = p.id和temMap.gradeType.id =:gradeType其中 p.organization.organizationTypeId =:orgType和p.clientId =:用p的clientId 順序。機構名稱」);
我不知道爲什麼這不起作用。請幫忙!關於語法錯誤