-->
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: hibernate pagination problem
PostPosted: Fri May 28, 2010 7:32 am 
Newbie

Joined: Fri May 28, 2010 6:48 am
Posts: 1
I'm using postres database and hibernate in my application.
Database pagination is working ok untill with this example:

in database table A i have columns id,value1,value2,and others not relevant here...

for example I have:

id value1 value2 other columns...
.
.
rowN: 5 2345 0 some data
rowN+1: 6 0 2345 same data as in row1
.
.
I'm using sort by greatest(value1,value2) function.

The problem is when i use pagination with 5 rows per page (data is displayed in rich datatable with datascroller and 5 rows per page):

when rowN with id 5 is displayed in page1 as the last row (row 5 in datatable with 5 rows per page),
then rowN+1 with id 6 should be in page2 as the first row (row 1 in datatable with 5 rows per page)
but this is not happening ! Instead, rowN is again displayed as the first row in page2 and rowN+1 is lost ??!!
How can that be ?
When i check ids that hibernate returns whit this search I clearly see id 5 as last record and then again id 5 as first record (and should be id 6) !
It looks like hibernate evaluating of greatest(value1,value2) is not working well in this example with pagination as it returns twice the same row...
Does anyone know what could be the problem ?
Thanks in advance.


Top
 Profile  
 
 Post subject: Re: hibernate pagination problem
PostPosted: Fri May 28, 2010 3:30 pm 
Regular
Regular

Joined: Tue May 11, 2010 5:50 pm
Posts: 54
Location: Norman, Ok, U.S.A
Can you post your code here where you are running the 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.