Hi,
LE-QUERE Gildas - REN wrote:
Hi David,
Thanks for your solution with the proxy, I tried it. The relationship is
loaded when I navigate however the elements are not filtered.
When a proxy is used a proxy instance is set in the relationship attribute.
The proxy instance contains the criteria to get the collection when the
relationship is navigated, this criteria is not my criteria to filter the
loading.
Not sure, but maybe this could be useful
http://db.apache.org/ojb/docu/guides/advanced-technique.html#Customizing+collection+queries
regards,
Armin
The final goal is to get a collection of B where the filter='yyy' and and
the name of the A owner is 'xxx'
like the SQL statement :
select b
from A (alias) a, B (alias) b
where a.name='xxx'
and b.oid=a.oid
and b.filter='yyy'
regards
Gildas
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 25, 2004 10:26 AM
Subject: RE: collection loading and filtering
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:[EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]