KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I use the following query to get a java.util.Map with indexes id , text and object : Query q = mySession.createQuery( "SELECT u.id AS id, u.name AS text, u AS object FROM User u") .setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP); ... but object seems to be a reserved word. For example obj is OK. What is the current way to escape an alias in HQL the way MySQL uses backtick escapes? Using backtick gives the following error: Exception in thread "main" org.hibernate.QueryException: unexpected char: '`' [SELECT u.id AS id, u.name AS text, u AS `object` FROM User u]
Tags (comma-separated)
Save Edits
Cancel