问题描述
意外标记: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;
我做错了什么?
谢谢
好像在 请参阅本文。 I am new to hibernate and trying to run query in hibernate but i am getting the exception that Here is the code what i am doing wrong ? Thanks Seems like there is a mapping association missed in your Please refer this. No defined association in hbm.xml file 这篇关于获取错误的意外标记:在第1行第135列附近打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! hbm.xml中没有映射关联。$ c
$ b
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.