Hi, this is my query and I have some problem:
(it worked before migration to hibernate 3)
HbQueryBuffer buffer = HbQueryBufferImpl.create(approvementListFieldMapping, getConfig());
buffer.setFrom(" BilansTeleAApprovementModel AS approvement inner join approvement.customerCase as case"
+ " inner join case.customer as customer1 inner join case.customer2 as customer2 ");
buffer.setSearchCriteria(criteria);
buffer.appendCustomWhere(" approvement.recordType = '" + type.getName() + "'");
return buffer;
Quote:
Error
org.springframework.orm.hibernate3.HibernateQueryException
Opis błędu
unexpected token: case near line 1, column 188
Quote:
caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: case near line 1, column 188 [select approvement.userComment, approvement.createdBy, approvement.cancelled, customer1.custCode, customer2.custCode, customer1.customerId, customer2.customerId, approvement.createdDate, case.systemDescription, case.nip, approvement.objectId, case.pass, case.pesel, case.regon from ***.BilansTeleAApprovementModel AS approvement inner join approvement.customerCase as case inner join case.customer as customer1 inner join case.customer2 as customer2 where approvement.recordType = 'telea' and rownum <= 500 order by approvement.cancelled asc]
Code:
caused by: line 1:188: unexpected token: case
org.hibernate.hql.antlr.HqlBaseParser.caseExpression(HqlBaseParser.java:3311)
org.hibernate.hql.antlr.HqlBaseParser.unaryExpression(HqlBaseParser.java:3164)
org.hibernate.hql.antlr.HqlBaseParser.multiplyExpression(HqlBaseParser.java:3082)
org.hibernate.hql.antlr.HqlBaseParser.additiveExpression(HqlBaseParser.java:2802)
org.hibernate.hql.antlr.HqlBaseParser.concatenation(HqlBaseParser.java:570)
org.hibernate.hql.antlr.HqlBaseParser.relationalExpression(HqlBaseParser.java:2586)
org.hibernate.hql.antlr.HqlBaseParser.equalityExpression(HqlBaseParser.java:2449)
org.hibernate.hql.antlr.HqlBaseParser.negatedExpression(HqlBaseParser.java:2413)
org.hibernate.hql.antlr.HqlBaseParser.logicalAndExpression(HqlBaseParser.java:2331)
org.hibernate.hql.antlr.HqlBaseParser.logicalOrExpression(HqlBaseParser.java:2296)
org.hibernate.hql.antlr.HqlBaseParser.expression(HqlBaseParser.java:2082)
org.hibernate.hql.antlr.HqlBaseParser.aliasedExpression(HqlBaseParser.java:2249)
org.hibernate.hql.antlr.HqlBaseParser.selectedPropertiesList(HqlBaseParser.java:1462)
org.hibernate.hql.antlr.HqlBaseParser.selectClause(HqlBaseParser.java:1365)
org.hibernate.hql.antlr.HqlBaseParser.selectFrom(HqlBaseParser.java:1106)
org.hibernate.hql.antlr.HqlBaseParser.queryRule(HqlBaseParser.java:702)
org.hibernate.hql.antlr.HqlBaseParser.selectStatement(HqlBaseParser.java:296)
org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:159)
org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:238)