cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: Prefetching and iterated queries
Date Mon, 05 Oct 2009 12:33:37 GMT
You may try "joint prefetching" :

This should let the query go through, and the data rows that you get  
back will contain data for the joined entity. There are a few caveats  

* Cayenne 2.0 uses INNER joins for joint prefetching, potentially  
reducing the number of rows in the result. 3.0 correctly uses OUTER  
joins, and generally has better prefetching support.

* DataContext.objectFromDataRow(..) will not take prefetching into  
account, and will only instantiate the root entity. There's no  
workaround (even in 3.0) other than working with data rows without  
turning them into objects.


On Oct 5, 2009, at 10:00 AM, Mark Fraser wrote:

> Using version 2.0.4....
> Is it possible to use prefetching with iterated queries (or to  
> otherwise achieve the same effect)?
> I added prefetches to my iterated query and got the runtime excpetion:
> "Iterated queries are not allowed in a batch."
> I don't get this error when I don't add the prefetches so I guess  
> what I'm really asking is is there a way to achieve prefetching with  
> iterated queries?
> Thanks

View raw message