Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

count(1) raising an error unexpected token: 1

 
aravind yarram
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The following HQL is resulting in parsing error at count (1). The problem is at the numeric 1 I am using in the count function. If i use a column name instead of the constant, the query executes successfully. Is this a restriction of hibermate?

select count(1) from Csa c where c.equipment.equipmentType = 'MA'

Thanks for your help!

Hibernate version: 3.x
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, just change it to an attribute of Csa.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic