-->
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.  [ 5 posts ] 
Author Message
 Post subject: Quote an alias or property in HQL (not SQL)?
PostPosted: Tue Sep 06, 2005 4:57 am 
Newbie

Joined: Thu Nov 18, 2004 10:07 am
Posts: 7
Hello,

is there a possibility to quote an alias or property within HQL (not SQL)? The following hql-query is generated automatically from my application, but is not recognizeds as a valid one, due to the usage of the "order" keyword as an alias name:

Code:
select o from mymodel.Invoice as o left join o.order as order order by order.orderId


causes the following error: BY expected after GROUP or ORDER

I looked at the HQL definition, but I wasn't able to find any HQL quote characters. I've tried {} or `` as quotes for the "order" alias, without success. My current solution is to rename the alias in "order_", but I think a general quoting of alias or properties will be a better solution.

Thanks
Peter

Hibernate version:3.0.5

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using: MS SQL Server

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2005 11:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
No, it is not possible.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2005 1:19 pm 
Newbie

Joined: Thu Nov 18, 2004 10:07 am
Posts: 7
gavin wrote:
No, it is not possible.


Is there a chance to implement quoting?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 14, 2006 5:05 pm 
Newbie

Joined: Fri Feb 10, 2006 2:57 am
Posts: 14
posted a feature request in Jira for this item. As I mentioned in the issue, I'd be happy to help if someone can give me a pointer towards the right parts of the code.

http://opensource.atlassian.com/project ... e/HHH-1912


Top
 Profile  
 
 Post subject: feature request?
PostPosted: Fri Jul 14, 2006 5:06 pm 
Newbie

Joined: Fri Feb 10, 2006 2:57 am
Posts: 14
posted a feature request in Jira for this item. As I mentioned in the issue, I'd be happy to help if someone can give me a pointer towards the right parts of the code.

http://opensource.atlassian.com/project ... e/HHH-1912


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