hi charles,

imo projectionAttributes and prefetcheRelationships are two completely different things. afaik (after trying to write a testcase) projectionAttribute change the search_class of a query.

jakob

Charles Anthony schrieb:

That'd be cool - I've never even heard of it, and a search of the mailing
list archives only turns up references in code for patches.

Anyone got a handy description of what projectionAttribute does (and how
it's different to, say, prefetchedRelationship) ?

Cheers,

Charles.


-----Original Message-----
From: Jakob Braeuchi [mailto:[EMAIL PROTECTED]
Sent: 27 October 2004 17:55
To: OJB Users List
Subject: Re: collection loading and filtering


hi gildas,

could you please post the sql without and with projectionAttribute.
i'd like to write a testcase and eventually document this feature.

jakob

LE-QUERE Gildas - REN schrieb:

Excellent!  that's right.

Thanks for your help

Gildas

----- Original Message ----- From: "Maksimenko Alexander" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, October 27, 2004 4:27 PM
Subject: Re: collection loading and filtering



query.setObjectProjectionAttribute("elements") will solve your problem



Hi Alexander,

I tried your suggestion. With the

"addPrefetchedRelationship()"method all

elements of the relationship are loaded. The filter

criteria, here, is a

condition to retrieve the A object. In fact it's the right

behaviour for

this request.

The problem is to realize a kind of left outer join in OOP

to get the

Collection of B which belong to A.

In fact I use the A data to find some B elements. Now I

think to load a

filtered relationship is not very good idea.

As a last resort I can use the sqlStatement but I loose the

transparency of

the persistence.

Thanks

Gildas

----- Original Message ----- From: "Maksimenko Alexander" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, October 27, 2004 2:25 PM
Subject: Re: collection loading and filtering



did you try query.addPrefetchedRelationship("elements") ?





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]



---------------------------------------------------------------------

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]





___________________________________________________________
HPD Software Ltd. - Helping Business Finance Business
Email terms and conditions: www.hpdsoftware.com/disclaimer




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



Reply via email to