-->
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.  [ 1 post ] 
Author Message
 Post subject: Hard query with rownums on SQL Server - help needed
PostPosted: Thu May 22, 2008 8:38 am 
Newbie

Joined: Sun Apr 06, 2008 2:49 pm
Posts: 17
Hi,

I want to use hibernateTemplate.Find(query, paramValues) to execute such query

select A.*
from PersonModel A
inner join
( select row_number() over(order by B.SIZE) lp, B.PERSONID p from CarModel B
) window
on window.p = A.ID
and window.lp between 34 and 55
order by window.lp

How to create HQL QUERY if there is no inner join "ON" in HQL language - the relations have to be defined in hbms so only iner join on object is permitted...
On the other hand the "window" is my virtual object so I cant delete the
on window.p = A.ID part .. ???

I would like to use HQL so how to write the above query...

I need to have ORDERED results with specific rownum


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.