0
我新的休眠和我有一個查詢收到錯誤嵌套的例外是org.hibernate.hql.ast.QuerySyntaxException:路徑預期的加入
select * from Losa_App a
inner join
os_historystep os
on
a.app_ref_no = os.ref_id
where
os.step_name = '011' and app_status = 'R' or app_status = 'S' ;
當我的SQLDeveloper運行此查詢運行和給我結果。現在我翻譯的查詢到HBL樣
StringBuffer query = new StringBuffer();
List<String> lstObj = new ArrayList<String>();
query.append(" from ");
query.append(getClassName());
query.append(" a inner join "
// + WflWorkflowHistoryStep.class.getName()
+ " OS_HISTORYSTEP os with a.appRefNo = os.ref_id "
+ "where os.step_name = '011' and a.appStatus = 'R' or a.appStatus = 'S' ");
List<LosaApp> result = null;
try {
result = getHibernateTemplate().find(query.toString());
if (CollectionUtils.isNotEmpty(result) {
return result;
}
} catch (Exception e) {
String message = e.getMessage();
System.out.println();
}
return null;
但是,當這個查詢運行我得到異常
nested exception is org.hibernate.hql.ast.QuerySyntaxException: Path expected for
join! [ from com.thetasp.losa.data.LosaApp a inner join OS_HISTORYSTEP os with
a.appRefNo = os.ref_id where os.step_name = '011' and a.appStatus = 'R'
or a.appStatus = 'S' ]
爲什麼我收到這個錯誤?
謝謝