-->
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.  [ 4 posts ] 
Author Message
 Post subject: alias in HQL
PostPosted: Fri Apr 30, 2004 9:52 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
How can I do to create the following query?

select o.idObj, o.name name, 'SOME STRING' type from AnObject o

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 30, 2004 1:42 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
alias of proeprties is not allowed on HQL, use the object graph navigation instead

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 30, 2004 3:52 pm 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
do you have an example????

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 01, 2004 3:39 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Code:
select o.idObj, o.name from AnObject o where o.name = :name

BTW plain string in select part is not allowed in the current version.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.