I have written below query in hibernate and it is giving me NullPointerException
SELECT new com.reddy.ReddyDTO( col1, IF(STRCMP(COL8, 'zero')=0, 'string', col2) )
FROM entity
However it is throwing me NPE as it was unable to determine data type for second column as String type.
I can see that it was unable to determine a type by looking at below location
in org.hibernate.hql.ast.tree.ConstructorNode.resolveConstructor(String path)
method, the field constructorArgumentTypes
is having values (org.hibernate.type.StringType, null)
How to make hibernate understand this column is of String data type? (I have already trying to put "string" in double-quotes, but that is giving me error)