获取错误的意外标记

获取错误的意外标记

本文介绍了获取错误的意外标记:在第1行第135列附近打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



 意外标记:ON在第1行第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 +));
}

列出< LosaCustContactZ> resultList = null;
try {
resultList = getHibernateTemplate()。find(query.toString(),
new Object [] {appRefNo,appDate});
} catch(Exception e){
String message = e.getMessage();
System.out.println();
}
返回resultList;

我做错了什么?

谢谢

解决方案

好像在 hbm.xml中没有映射关联。 $ b

请参阅本文。


I am new to hibernate and trying to run query in hibernate but i am getting the exception that

unexpected token: ON near line 1, column 135 [SELECT A.comp_id.appRefNo ....

Here is the code

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;

what i am doing wrong ?

Thanks

解决方案

Seems like there is a mapping association missed in your hbm.xml.

Please refer this.

No defined association in hbm.xml file

这篇关于获取错误的意外标记:在第1行第135列附近打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 06:55