• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

ClassicQueryTranslatorFactory & Custom Functions Doesn't work?

 
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using hibernate 3.2.1-ga version.


I have extended the DB2Dialect and defined my own function:
registerFunction("svminus1", new NoArgSQLFunction("current time", Hibernate.TIME, false) );

It is working fine with ASTQueryTranslatorFactory

HQL: select svminus1() from Temp c where c.id=1
SQL: select current time as col_0_0_ from TEMP c0_ where c0_.ID=1


But when i use ClassicQueryTranslatorFactory, it gives me errors:
org.hibernate.QueryException: aggregate function expected before ( in SELECT [select svminus1() from Temp c where c.id=1]

Why am i getting this error?
 
Everybody's invited. Even this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!