-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Please for urgent help, migrating hibernate 2->3
PostPosted: Thu Feb 02, 2006 7:58 am 
Beginner
Beginner

Joined: Tue Nov 22, 2005 6:55 am
Posts: 41
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)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 02, 2006 9:13 am 
Beginner
Beginner

Joined: Tue Nov 22, 2005 6:55 am
Posts: 41
i've found the reason - the case is forbidden keyword .
I 've changed its name and it works


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.