1

My Query in java:

QUERY_STRING = "select a.seqNum,a.eventId,a.srcAddress,a.srcUser,REPLACE(a.message,',',' ') as message,a.createdTime,a.type,a.networkGroupName from Fraud a";

Getting Exception as Follows:

04:38:55,193 ERROR AppEntityManager:90 - java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.MethodNode
 +-[METHOD_CALL] MethodNode: '('
 |  +-[METHOD_NAME] IdentNode: 'REPLACE' {originalText=REPLACE}
 |  \-[EXPR_LIST] SqlNode: 'exprList'
 |     +-[DOT] DotNode: 'fraud0_.MESSAGE' {propertyName=message,dereferenceType=4,propertyPath=message,path=a.message,tableAlias=fraud0_,className=com.redshift.mgmt.entity.Fraud,classAlias=a}
 |     |  +-[ALIAS_REF] IdentNode: 'fraud0_.ALERT_ID' {alias=a, className=com.redshift.mgmt.entity.Fraud, tableAlias=fraud0_}
 |     |  \-[IDENT] IdentNode: 'message' {originalText=message}
 |     +-[QUOTED_STRING] LiteralNode: '',''
 |     \-[QUOTED_STRING] LiteralNode: '' ''
1
  • share the snap of your Fraud class Commented Mar 1, 2021 at 12:55

1 Answer 1

5

The replace function is not known to Hibernate so it also doesn't know the result type that it should use for retrieving results from JDBC. Either register the function in your Dialect or wrap a cast around: CAST(REPLACE(a.message,',',' ') as java.lang.String)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.