I submitted a patch earlier that allows a different method of prefetching 
related objects and does indeed allow prefetching for more than one level 
deep.  All data is returned in one query by joining tables and getting all 
fields for the related objects.  The patch files were based off what I got out 
of cvs and aren't based on the tagged rc4, so I'll have to update the patch 
for you if you are interested.

I think deep prefetching is useful for our app, which at times needs to load a 
large set of data for some analysis and optimization and the whole object 
graph is useful.  It is also useful for many reports.

The patch was included on this message:
http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=752859

and described here:
http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=751991


John Marshall
Connectria

>===== Original Message From "OJB Users List" <[EMAIL PROTECTED]> =====
>Hello,
>
>> -----Original Message-----
>> From: Jakob Braeuchi [mailto:[EMAIL PROTECTED]
>
>> prefetching currently works only for one level . the prefetcher looks
>> for a relationship named
>>
>> "allb.singlec" in A.class in your sample.  the query criteria
>> has no effect on prefetching.
>> i'm not sure whether deep prefetching is really useful.
>
>Such a feature would really make me happy. What do you think,
>is it difficult to implement?  Are there other people
>having that need?
>
>Olli
>
>> >Does anyone know if prefetched relationships can reach more
>> than one "layer"
>> >of references/collections from an class being queried?
>> >E.g. If I have a class A that I an querying and it has a 1:m
>> relationship
>> >with some class B, with the relationship defined by the name "allb",
>> >and then each B has 1 1:1 relationsbip with another class C, with the
>> >relationship called "singlec", is the following supposed to work:
>> >
>> >    Criteria criteria = new Criteria();
>> >      // configure the criteria
>> >      ...
>> >
>> >      // add prefetched relationships
>> >    criteria.addPrefetchedRelationship("allb");
>> >    criteria.addPrefetchedRelationship("allb.singlec");
>> >
>> >      Query q = QueryFactory.newQuery( A.class, criteria);
>
>---------------------------------------------------------------------
>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