title: GAE caching objectify queries
body: <p>i have a simple question</p>
  
  <p>in the objectify documentation it says that "Only get(), put(), and delete() interact with the cache. query() is not cached"
  <a href="http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify#Global_Cache" rel="nofollow">http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify#Global_Cache</a>.</p>
  
  <p>what i'm wondering - if you have one root entity (i did not use @Parent due to all the scalability issues that it seems to have) that all the other entities have a Key to, and you do a query such as </p>
  
  <pre><code>ofy.query(ChildEntity.class).filter("rootEntity", rootEntity).list()
  </code></pre>
  
  <p>is this completely bypassing the cache?</p>
  
  <p>If this is the case, is there an efficient caching way to do a query on conditions - or for that matter can you cache a query with a parent where you would have to make an actual ancestor query like the following</p>
  
  <pre><code>Key&lt;Parent&gt; rootKey = ObjectifyService.factory().getKey(root)
  ofy.query(ChildEntity.class).ancestor(rootKey)
  </code></pre>
  
  <p>Thank you</p>
  
  <hr>
  
  <p>as to one of the comments below i've added an edit</p>
  
  <p>sample dao (ignore the validate method - it just does some null &amp; quantity checks):</p>
  
  <p>this is a sample find all method inside a delegate called from the DAO that the request factory ServiceLocator is using</p>
  
  <pre><code>public List&lt;EquipmentCheckin&gt; findAll(Subject subject, Objectify ofy, Event event) {
    final Business business = (Business) subject.getSession().getAttribute(BUSINESS_ATTRIBUTE);
    final List&lt;EquipmentCheckin&gt; checkins = ofy.query(EquipmentCheckin.class).filter(BUSINESS_ATTRIBUTE, business)
      .filter(EVENT_CONDITION, event).list();
    return validate(ofy, checkins);
  }
  </code></pre>
  
  <p>now, when this is executed i find that the following method is actually being called in my AbstractDAO. </p>
  
  <pre><code>/**
  * 
  * @param id
  * @return
  */
  public T find(Long id) {
    System.out.println("finding " + clazz.getSimpleName() + " id = " + id);
    return ObjectifyService.begin().find(clazz, id);
  }
  </code></pre>