So I have a number of statements where “where” clause has inline parameter assignment
something like
UPDATE EntityC c SET c.cName='N' and c.variableParameter=:p1 WHERE c.something=:p2
in my entity EntityC cName declared as java.lang.Character
and now hibernate complains
java.lang.IllegalArgumentException: org.hibernate.query.SemanticException: The assignment expression type [java.lang.String] did not match the assignment path type [java.lang.Character] for the path c.cName
so it treats ‘N’ in jpql as string. is there easy way to let it know that ‘N’ is character and not string ?
I tried cast(‘N’ as java.lang.Character) and it worked, is there a “lighter” way to do that ? Something like 'N’c or some “magic quotes” that will be parsed as char ? Like something that will be easy to use for find & replace editor feature ?
Giving that I have a number of places it will take some time to replace, unless I’ll find some way to automate that…