Hello All,
To solve my above problem, I tried to Register Sql Function. but it's also not working
I extends Oracle9Dialect as following
public class MyOracle9Dialect
extends net.sf.hibernate.dialect.Oracle9Dialect {
public Oracle9Dialect() {
super();
registerFunction("getClientRank", new StandardSQLFunction(Hibernate.INTEGER));
}
}
As per discussion in below link, oracle function with one argument will work.
So, I modify my getClientRank function and pass only one argument.
but then also it not working, It give me same error
http://opensource.atlassian.com/project ... B-158.html
_________________________________________________________________
Error
No data type for node: org.hibernate.hql.ast.tree.MethodNode
\-[METHOD_CALL] MethodNode: '('
+-[METHOD_NAME] IdentNode: 'getClientRank' {originalText=getClientRank}
\-[EXPR_LIST] SqlNode: 'exprList'
\-[DOT] DotNode: 'client_m0_.clientid' {propertyName=clientid,dereferenceType=4,propertyPath=clientid,path={synthetic-alias}.clientid,tableAlias=client_m0_,className=com.applied.hib.order.client_m,classAlias=null}
+-[IDENT] IdentNode: '{synthetic-alias}' {originalText={synthetic-alias}}
\-[IDENT] IdentNode: 'clientid' {originalText=clientid}
at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:167)
at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:727)
at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:551)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:645)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:251)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:183)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:134)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1650)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342)
at $Proxy0.createQuery(Unknown Source)
at com.applied.hib.order.OrderVerifyPreparedStatement.executeHQLDBFunction(OrderVerifyPreparedStatement.java:63)
at com.applied.hib.order.OrderVerifyPreparedStatement.main(OrderVerifyPreparedStatement.java:45)