-->
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.  [ 3 posts ] 
Author Message
 Post subject: Giving alias name to a formula property.
PostPosted: Wed Apr 16, 2008 6:48 pm 
Newbie

Joined: Mon Mar 17, 2008 2:09 pm
Posts: 8
Hi All,

I defined a property with below query in formula

( select distinct hp.project_name
from help_projects hp, help_comments hc
where hp.project_id = this_.PROJECT_ID)

and it is generating below query while running the application

select this_.TICKET_ID as TICKET1_3_0_,
( select distinct hp.project_name
from help_projects hp, help_comments hc
where hp.project_id = this_.PROJECT_ID)
as formula0_0_,
from HELP_COMMENTS this_ where this_.priority=? and this_.status=? order by this_.CREATED_DT desc

Hibernate is defining alias name 'formula0_0_', is there a way we can give alias name to this query?? If not, can I use this alias name('formula0_0_') in the order by clause(it is in-built to Hibernate so whether this will change over a time)??

Thanks in advance.

Regards,
Sharath.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 17, 2008 1:04 am 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
Why do you want to do that?

_________________
Sukirtha


Top
 Profile  
 
 Post subject: Giving alias name to a formula property.
PostPosted: Thu Apr 17, 2008 9:27 am 
Newbie

Joined: Mon Mar 17, 2008 2:09 pm
Posts: 8
In sybase we cannot use a query in order by clause. When I want to do sort depending upon the value of the property it will use the formula query and sybase is throwing error.

Sharath.


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