You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Mahler Thomas <th...@itellium.com> on 2003/05/28 15:11:14 UTC

RE: [Feature Request] retrieving a collection from reportqueries / pa ging with reportqueries

Hi Roger,

> -----Original Message-----
> From: Janssen, Roger [mailto:Roger.Janssen@ibanx.nl]
> Sent: Wednesday, May 28, 2003 3:02 PM
> To: 'OJB Users List'
> Subject: [Feature Request] retrieving a collection from 
> reportqueries /
> pa ging with reportqueries
> 
> 
> hi,
> 
> i'm using report queries to retrieve external data (data from other
> systems). i'm using an empty classdescriptor for some kind of 
> proxy-class
> that is dynamically modified for each request in which the 
> proxy-class is
> mapped onto the table of the external data source. no field 
> descriptors are
> defined (using columnnames), no need for them in this case.
> 
> our own layers, using ojb underneath, would like to have Collections
> returned from queries (we might need to iterate over them 
> more then once),
> also from the data retrieved from the external datasource.
> 
> because the retrieved datasets might be large, we would like 
> to be able to
> use setStartIndex/setEndIndex on reportqueries as well.
> 
> currently, ojb returns an iterator as the result of a 
> reportquery. are there
> any plans implementing it returning a Collections? and are 
> there any plans
> of implementing the paging just like with 'normal' queries?

No there are no such plans currently.
My suggestion would be to write a little wrapper class that implements
collection and is backed by the Iterator returned from the PB.
This CollectionIteratorWrapper can be very generic and it could also handle
the paging stuff.

I'd prefer not to add additional methods to the PB interface but use such a
wrapper.

It should be fun to write, and I'll promise to add all contributions to the
codebase ;-)

cheers,
Thomas

> thanx,
> 
> Roger Janssen
> 
> 
> **************************************************************
> ***********
> The information contained in this communication is confidential and is
> intended solely for the use of the individual or entity to  whom it is
> addressed.You should not copy, disclose or distribute this 
> communication 
> without the authority of iBanx bv. iBanx bv is neither liable for 
> the proper and complete transmission of the information has 
> been maintained
> nor that the communication is free of viruses, interceptions 
> or interference.
> 
> If you are not the intended recipient of this communication 
> please return
> the communication to the sender and delete and destroy all copies.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 


Update objects suggestion

Posted by casterx <ca...@netzero.net>.
After using OJB on a number of web projects, I keep encountering the same
problem of updating partial object data from a struts form. for example, an
object might contain 10 fields, with one PK and a few FKs. the form however,
only contains 5 fields. Since the update action doesn't get a hold of the
full object, I either have to put the original object in the session scope
or re-query it inside the update action for a second time. It seems like an
updateOnly method might come in handy for such operations. Basically, it
would work like store(), but instead of updating every single field, it
would update all the non-null members of the class and throw an exception of
the object is not already in the database.

Another way, might be to convert identity objects to a String and be able to
use that string to create a new identity object in the update action to use
that for retrieval so that the cache would be hit.

What do you guys think? How are you guys solving this problem?

Thanks
Caster