Reputation: 463
I'm trying to call a function in a named query, but im getting :
java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.MethodNode
\-[METHOD_CALL] MethodNode: '('
+-[METHOD_NAME] IdentNode: 'MYFUNCTION' {originalText=MYFUNCTION}
\-[EXPR_LIST] SqlNode: 'exprList'
\-[NUM_INT] LiteralNode: '1'
and my query is something like
@NamedQuery(name = "myQuery",
query = " select r, MYFUNCTION(r.id) from ResPO r "
+ " where r.status like 'A'")
If I simplify my query, all is ok:
@NamedQuery(name = "myQuery",
query = " select r from ResPO r "
+ " where r.status like 'A'")
What is the mistake? Thanks++
Upvotes: 0
Views: 1566
Reputation: 18553
You can do it by extending the dialect you're using and registering your function by calling the registerFunction()
method.
Upvotes: 1