db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From LE-QUERE Gildas - REN <gildas.lequ...@atosorigin.com>
Subject collection loading and filtering
Date Mon, 25 Oct 2004 08:06:08 GMT
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

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 ?



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

View raw message