-->
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.  [ 2 posts ] 
Author Message
 Post subject: Native sql - rownum range - bug !??
PostPosted: Thu Jul 16, 2009 12:50 am 
Newbie

Joined: Mon Jul 13, 2009 7:56 pm
Posts: 5
Hi,

I have the following set of classes
A extends B (joined-subclass in hibernate)

the foll query..
select a.*, b.* from B b inner join A a on a.id = b.id
query.addEntity("b",B.class);

yields the desired result..

however, setting setFirstResult and setMaxRows screws up everything.. Is this a bug or am I doing something wrong? Can anyone please help out with this?

Thanks..


Top
 Profile  
 
 Post subject: Re: Native sql - rownum range - bug !??
PostPosted: Thu Jul 16, 2009 10:51 am 
Newbie

Joined: Mon Jul 13, 2009 7:56 pm
Posts: 5
Solved - I can manipulate the generated query as follows...
With X as (
select row.rownum_ b.* from ....
all row num stuff blah blah
) base
select a.*, b.* from base..

So now, I can put in parallel hints and use ORM for this native query..


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