On 19/05/2010, at 5:30 PM, Gary Jarrel wrote:

> Do you think it is something that could be implemented via Annotations?
> 
> Perhaps a class level or method annotation
> 
> @Prefetch("products.orders");
> public class Category() {
> 
>    @Prefetch // this could pre-fetch products
>    @Prefetch("orders") // this could pre-fetch products.orders
>    public List<Product> getProducts() {
>        ....
>    }
> }

You could utilise those annotations yourself, in the absence of an officially 
supported mechanism, by subclassing SelectQuery and creating your own library 
of annotations (with runtime retention) and it'd be quite simple.

I suspect a more official approach would involve adding prefetch definitions to 
the model.

with regards,
--

Lachlan Deck

Reply via email to