-->
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: Inline Queries
PostPosted: Tue Dec 19, 2006 12:29 pm 
Newbie

Joined: Tue Dec 19, 2006 12:19 pm
Posts: 4
Hi all,

I'm trying to use inline query in HQL,
like exists in Oracle's dialect and support,
for example:

Code:
select t.id, t.a, iq.rows_count
from  tab1 as t
        ,(select id, count(0) as rows_count
          from tab2
          group by id
         ) as iq
where t1.id = iq.id


but when i try to run it in HQL it fails,
and throws :

unexpected token: ( near line 1, column 57 [select t.id, t.a, iq.rows_count from tab1 as t ,(select id, count(0) as rows_count from tab2 group by id ) as iqwhere t1.id = iq.id]

Any suggestions?
thank you

_________________
!!!Sharik!!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 19, 2006 3:25 pm 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
What do you want to get as a result? You can also call your SQL as is doing session.createSQLQuery("your query");

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
 Post subject: Stick with HQL
PostPosted: Thu Dec 21, 2006 5:22 am 
Newbie

Joined: Tue Dec 19, 2006 12:19 pm
Posts: 4
Hi,

I know i can create an SQL Query,
but i'm trying to avoid it.
I want to stick with HQL, but it doesn't seem to support
the Inline Query.

Thank you

_________________
!!!Sharik!!!


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.