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: [PFE] fetching proxy's identities
Date Sat, 20 Dec 2003 16:20:49 GMT
hi robert,

if you want to read specific columns only then you can already use 
report queries.
i do not like the idea of definig columns for 'real object' queries 
because this leads to partially loaded objects. suppose you only load 
columns {"id, name, description"}. this 'incomplete' object will be put 
into the cache. subsequent queries asking for all columns will the 
return the 'incomplete' object.

just my 0.02 CHF

jakob

Robert S. Sfeir wrote:

> I'm not a commiter, but +1 from here.  I've always favored defining the 
> colums you want to get v/s select *.  The issue I think it going to be 
> that often we pass in a bean which contains all the columns regardless, 
> so we'd need to specify which bean properties we want to fetch as part 
> of the Query, something like:
> 
> crit.addLike( "upper(name)", "%" + acronymName.toUpperCase() + "%" );
> 
> would do select * for the name.  We should have something which would 
> let us also add to the criteria:
> 
> String cols[] = {"id, name, description"};
> crit.addReturnColumns(cols);
> 
> or
> 
> crit.addReturnColumn("id");
> crit.addReturnColumn("name");
> crit.addReturnColumn("description");
> 
> which would turn into
> 
> select id, name, descrition from table where name=...
> 
> of course you'd also have to handle joins and group by properly, which 
> can make this for pretty hairy code, but most likely more efficient.
> 
> R
> 
> Oleg Nitz wrote:
> 
>> Hi All,
>>
>> I noticed that when OJB loads proxy objects, it fetches all columns 
>> from database, but then uses only few of them to build the Identity.
>> Is there any reasons for this?
>> I think this is rather inefficient, I propose to fetch only those 
>> columns that object's identity consists of. I understand that this 
>> means quite many changes to core classes, so this optimisation should 
>> be for 1.1 version of OJB, not for 1.0
>> What do you think?
>>
>> Oleg
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 


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