db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <j.heini...@ewerk.com>
Subject Re: getting fullsize() of an Iterator
Date Thu, 19 Feb 2004 20:02:19 GMT
Jakob Braeuchi <jbraeuchi <at> gmx.ch> writes:

> > we want to use OTM ...
> > 
> > Query q = QueryFactory.newQuery(Debitor.class, crit, true);
> > q.setStartAtIndex(offset + 1);
> > q.setEndAtIndex(offset + rowcount);
> > Iterator iter = conn.getIteratorByQuery(q);
> >
> > ... 
> >
> > 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.

Thanks for your fast and positive answer - I feared an intended strong
protection, so that I had to implement it myself though it might be only few
lines of code.

Now how to go on? I guess a patch is always welcome? Or is this change to be
done in 5 minutes for you?
If not which object shall be accessible where? Should for example the
OJBIterator of PersistenceBrokerImpl.getIteratorFromQuery() given to outside
instead of the implicite upcast in PersistenceBroker.getIteratorByQuery() - I
guess not. On the other you have to handle different iterators in
BaseConnection.OTMIterator as there is the generic Iterator as constructor
parameter. Maybe OJBIterator shall be used everywhere in OJB instead of Iterator?

As you might notice I need to know where to go relatively quickly. Any hints?

Joerg


---------------------------------------------------------------------
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