0 Replies Latest reply on Mar 2, 2009 10:59 AM by Kyle Sands

    skipping re-query for null left outer join object from query

    Kyle Sands Newbie

      Hi... I'm guessing this is just the way it is, but i'd like to confirm... I set up query caching for a few Named Queries and it seems to work good.. One exception case though is on a query like this...

       select x
       from OBJECT_X x
       join fetch x.object_a a
       left outer join fetch x.object_b b
       left outer join fetch x.object_c c
       left outer join fetch x.object_d d
       where x.id = :id_parm

      In some cases for example, if id_parm = 5, with the outer joins, Object_B and Object_C might be null, which is fine, so the other objects from the query get cached and Object_B and Object_C are not cached, so when the query is called again later, it knows B and C can't be pulled from the cache, so it fires new queries to try and get them from the database even though they will be null. Can i avoid the re-querying for B and C by a new config setting, or a change in the query perhaps, or would i need to code up a custom cache provider class by chance?