db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Re: getting fullsize() of an Iterator
Date Thu, 19 Feb 2004 18:10:29 GMT
hi joerg,

Joerg Heinicke wrote:
> Hello,
> 
> we want to use OTM for our application and came across the first problem today.
> We want to use paging for the query and so we use following code:
> 
> Query q = QueryFactory.newQuery(Debitor.class, crit, true);
> q.setStartAtIndex(offset + 1);
> q.setEndAtIndex(offset + rowcount);
> Iterator iter = conn.getIteratorByQuery(q);
> 
> Besides the objects to be shown at one page we also need to know the number of
> all hits, i.e. without any respect to start and end index. I found q.fullsize(),
> but this one is deprecated and always returns 0. The suggestion of using
> OJBIterator.fullsize() just is not possible.
> 
> Two things prevent that I get fullsize():
> 1. getIteratorByQuery(q) returns an Iterator which is in fact an OTMIterator - I
> can not cast down to OTMIterator as it is a private class.
> 2. OTMIterator does not forward the fullsize() call to the encapsulated Iterator
> (the OJBIterator).

this is imo due to the fact that i reworked the paging-stuff after the 
implementation of OTMIterator. i think OTMIterator should implement OJBIterator.

hth
jakob

> 
> Now my questions: Is this by intention? Do I have a wrong perception of what
> fullsize() is intended for? How to work around this besides implementing the
> offset/rowcount handling in the data access layer (calling the above code) or
> firing an extra query for the full size?
> 
> Thanks for any hint,
> 
> Joerg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message