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 Joose Vettenranta <jo...@iki.fi> on 2004/07/28 17:49:07 UTC

how to change auto-retrieve for a query?

Hi,

I want to retrieve lot's of data and not to retrieve it's childs (1:n 
relationship).

I'm using like:

		PersistenceManager persistenceManager = pmf.getPersistenceManager();
		PersistenceBroker broker = 
PersistenceBrokerFactory.defaultPersistenceBroker();
		QueryByCriteria query = QueryFactory.newQuery (beanClass, criteria, 
true);
		Collection results = broker.getCollectionByQuery(query);
		broker.close();
		return results;

but what do I have to say that it does not retreive beanClasses childs?

Thanks,

Joose

--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


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


Re: how to change auto-retrieve for a query?

Posted by Armin Waibel <ar...@apache.org>.
Maksimenko Alexander wrote:
> Armin Waibel wrote:
> 
>>
>> Use collection proxy for child objects
>> http://db.apache.org/ojb/docu/guides/basic-technique.html#Using+a+Single+Proxy+for+a+Whole+Collection 
>>
>>
>> or set auto-retrieve of your collection-descriptor to "none/false". 
>> But be careful when using this setting in combination with 
>> auto-update/delete "object/true", because you have to populate all 
>> child objects before do update/delete operation in this case
>> http://db.apache.org/ojb/docu/guides/basic-technique.html#auto-retrieve+setting 
>>
>>
>> By the way, in OJB 1.1 it will be possible to change the auto-xxx 
>> settings at runtime.
>>
>> regards,
>> Armin
>>
> 
> Will it be possible to change auto-xxx settings for each individual query ?
>

No sorry, this will be a new feature of 1.1.

Armin

> 

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


Re: how to change auto-retrieve for a query?

Posted by Maksimenko Alexander <ma...@bird.cris.net>.
Armin Waibel wrote:

>
> Use collection proxy for child objects
> http://db.apache.org/ojb/docu/guides/basic-technique.html#Using+a+Single+Proxy+for+a+Whole+Collection 
>
>
> or set auto-retrieve of your collection-descriptor to "none/false". 
> But be careful when using this setting in combination with 
> auto-update/delete "object/true", because you have to populate all 
> child objects before do update/delete operation in this case
> http://db.apache.org/ojb/docu/guides/basic-technique.html#auto-retrieve+setting 
>
>
> By the way, in OJB 1.1 it will be possible to change the auto-xxx 
> settings at runtime.
>
> regards,
> Armin
>

Will it be possible to change auto-xxx settings for each individual query ?


-- 
Maksimennko Alexander
Softwarium, www.softwarium.net


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


Re: how to change auto-retrieve for a query?

Posted by Armin Waibel <ar...@apache.org>.
Ji Joose,

Joose Vettenranta wrote:
> Hi,
> 
> I want to retrieve lot's of data and not to retrieve it's childs (1:n 
> relationship).
> 
> I'm using like:
> 
>         PersistenceManager persistenceManager = 
> pmf.getPersistenceManager();
>         PersistenceBroker broker = 
> PersistenceBrokerFactory.defaultPersistenceBroker();
>         QueryByCriteria query = QueryFactory.newQuery (beanClass, 
> criteria, true);
>         Collection results = broker.getCollectionByQuery(query);
>         broker.close();
>         return results;
> 
> but what do I have to say that it does not retreive beanClasses childs?
> 

Use collection proxy for child objects
http://db.apache.org/ojb/docu/guides/basic-technique.html#Using+a+Single+Proxy+for+a+Whole+Collection

or set auto-retrieve of your collection-descriptor to "none/false". But 
be careful when using this setting in combination with 
auto-update/delete "object/true", because you have to populate all child 
objects before do update/delete operation in this case
http://db.apache.org/ojb/docu/guides/basic-technique.html#auto-retrieve+setting

By the way, in OJB 1.1 it will be possible to change the auto-xxx 
settings at runtime.

regards,
Armin


> Thanks,
> 
> Joose
> 
> -- 
> "Always remember that you are unique, just like everyone else!"
> * http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 

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