gpt4 book ai didi

hibernate - 出现意外 token : ON near line 1, 列 135 的错误

转载 作者:行者123 更新时间:2023-12-03 12:23:55 26 4
gpt4 key购买 nike

我是 hibernate 的新手并试图在 hibernate 中运行查询,但我遇到了异常

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;

我做错了什么?

谢谢

最佳答案

您的 hbm.xml. 中似乎缺少映射关联

请引用这个。

No defined association in hbm.xml file

关于hibernate - 出现意外 token : ON near line 1, 列 135 的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15276136/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com