db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David.WIESZ...@cec.eu.int
Subject RE: collection loading and filtering
Date Mon, 25 Oct 2004 08:26:16 GMT
Hi Gildas,

You have to set proxy="true" in your collection descriptor.
Like that the relationship is loaded only if you navigate.

David WIESZTAL.


-----Original Message-----
From: LE-QUERE Gildas - REN [mailto:gildas.lequere@atosorigin.com] 
Sent: Monday, October 25, 2004 10:06 AM
To: OJB Users List
Subject: collection loading and filtering


Hi all,

I have un object A referencing à collection with B elements.

A has an attribute 'name' and a relation 'elements', B has an attribute
'filter'.

I want to load  elements where name='xxx' and filter='yyy'.

I use the PersitenceBroker API, here is my request:

   criteria = new Criteria();

   criteria.addEqualTo("name", 'xxx');
   criteria.addEqualTo("elements.filter", 'yyy');

   query = QueryFactory.newQuery(A.class, criteria);

   A a =  (A)broker.getObjectByQuery(query);

With  the relationship  auto-retrieve=true all elements are loaded!

If  auto-retrieve=false the relationship is not loaded.

Is there a solution ?


Thanks

Gildas

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


Mime
View raw message