Immer error, unexpected token: AUF Zeile 1, Spalte 135

Ich bin neu in hibernate und ausführen von Abfragen in hibernate, aber ich bin immer die Ausnahme, dass

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

Hier ist der 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;

was mache ich falsch ?

Dank

InformationsquelleAutor Basit | 2013-03-07

Schreibe einen Kommentar