我是休眠新手并尝试在休眠中运行查询,但我遇到了异常
unexpected token: ON near line 1, column 135 [SELECT A.comp_id.appRefNo ....
这是代码
StringBuffer query = new StringBuffer("SELECT A.comp_id.appRefNo,
A.comp_id.custId from ");
query.append(LosaCustContactZ.class.getName());
query.append(" A INNER JOIN " + LosaCust.class.getName() + " B
ON ( B.comp_id.appRefNo = A.comp_id.appRefNo AND " +
"B.comp_id.custId = A.comp_id.custId) INNER JOIN " + LosaApp.class.getName() + " C
ON " + "(B.comp_id.appRefNo = A.comp_id.appRefNo) ");
query.append("WHERE C.comp_id.appRefNo != ?" + " AND C.appDt >= ? AND
A.contactT = 'PHONE'" );
if (StringUtils.isNotEmpty(phoneNums)) {
query.append(" AND A.contact IN(" + phoneNums + ")");
}
List<LosaCustContactZ> resultList = null;
try {
resultList = getHibernateTemplate().find(query.toString(),
new Object[] { appRefNo, appDate });
} catch (Exception e) {
String message = e.getMessage();
System.out.println();
}
return resultList;
我做错了什么?
谢谢