-->
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: Subquery in select clause
PostPosted: Wed Apr 28, 2004 9:52 am 
Newbie

Joined: Wed Apr 28, 2004 9:41 am
Posts: 1
what is HSQL for the following example, with subquery in select clause?
what is the rule for the native sql <-> hibernate sql conversion?

For example, native sql is:
select a.name, (select b.desc from table2 b where b.code = a.code) as desc
from table 1 a


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 28, 2004 10:41 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Subselects in the select clause are not supported in HQL in the current version. Map a class property with the "formula" attribute.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 28, 2004 2:05 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
I think you can select the same with left join too.


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.