1

I'm trying to run this query

SELECT userType from Users as @type

But hibernate throws a syntax error.

org.hibernate.QueryException: unexpected char: '@'

I tried to use quotes but it didnt work as well.

Can this be done?

Joe Taras
  • 14,133
  • 7
  • 36
  • 51
Fabio K
  • 965
  • 3
  • 11
  • 20
  • Why you want to use @ instead a simple alias?. For me the correct use is select myalias.userType from Users myAlias – Joe Taras Jun 19 '18 at 13:37
  • The API Im using returns a map of the columns vs alias. I want this map to have '@type' as a key, automatically, without having to do it manually. Also, our json deserializer uses the '@type' key to identify the object's type. – Fabio K Jun 19 '18 at 14:05

0 Answers0