-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: HQL: aliases in select cannot contains spaces?
PostPosted: Thu Jun 03, 2010 1:13 pm 
Newbie

Joined: Mon Jun 26, 2006 4:52 am
Posts: 8
Hello all,

I'm trying to use aliases in select, and in order to have nice aliases in my medata for a future export, I'm trying to do something like this in HQL :

Code:
select distinct u.firstName as "First name" from User u

And get the following error:
Code:
unexpected char: '"' [select distinct u.firstName as "First name" from User u]

This would work fine in SQL but doesn't work with HQL... Hibernate doesn't seem to support an alias name enclosed in "" (or ' ').

Am I missing something there? Or it's just impossible for me to create an alias containing space chars?

Thanks for your help!


Top
 Profile  
 
 Post subject: Re: HQL: aliases in select cannot contains spaces?
PostPosted: Fri Jun 04, 2010 2:04 am 
Newbie

Joined: Wed May 03, 2006 7:22 am
Posts: 3
x


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.