Re: Default Prefetching

From: Lachlan Deck (lachlan.dec..mail.com)
Date: Wed May 19 2010 - 12:48:55 UTC

  • Next message: Andrus Adamchik: "Re: lifecycle callbacks, order of execution"

    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
    >
    >..refetch("products.orders");
    > public class Category() {
    >
    > ..refetch // this could pre-fetch products
    > ..refetch("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



    This archive was generated by hypermail 2.0.0 : Wed May 19 2010 - 12:49:35 UTC