On 10/3/05, Andrus Adamchik <andru..bjectstyle.org> wrote:
> Yeah, joint prefetches are needed in case of flattened. Look at it
> from the DB perspective - if there are two related tables and neither
> of them has an FK to another one, you have to have a join somewhere
> to figure it out. In Cayenne terms, person row snapshot doesn't have
> enough info to figure out related city ObjectId.
In some cases, I'd agree - though in other cases I would not. For
example, if I query across the relationship by path
(query.addPrefetch("toHouse.toCity")), then when I invoke
person.getToCity, it should work.
> query.addPrefetch(String); // Cayenne decides which one to use
> query.addPrefetch(String, int type); // User decides which type to use
>
What would the deciding factor be? Currently, the resolver
automatically converts joint prefetches to straight prefetches if the
user does a dangerous query. Maybe it could be reversed so that its
made into a joint prefetch if it *isn't* dangerous..
This archive was generated by hypermail 2.0.0 : Mon Oct 03 2005 - 17:11:42 EDT