-->
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.  [ 1 post ] 
Author Message
 Post subject: ClassicQueryTranslatorFactory&Custom Functions Doesn't work
PostPosted: Thu Jun 11, 2009 9:49 am 
Beginner
Beginner

Joined: Wed Aug 22, 2007 5:53 am
Posts: 38
I am using hibernate 3.2.1-ga version.

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

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:
HQL: select svminus1() from Temp c where c.id=1
SQL: select svminus1() as col_0_0_ from LIS.TBCONTROL controldat0_ where (controldat0_.CONTROLID=1000001221 )

COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0440N No authorized routine named "SVMINUS1" of type "FUNCTION"
having compatible arguments was found. SQLSTATE=42884

Why am i getting this error?
Also when converting HQL to SQL, it hasn;t replaced my custom function with it's definition.


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.