Re: prefetching

From: Tore Halset (halse..vv.ntnu.no)
Date: Wed Dec 10 2003 - 08:42:24 EST

  • Next message: Mike Block: "WARN: DefaultResultIterator: Error Bad Integer Dude?"

    One more thing...

    As described, the persons are fetched by a SelectQuery. I do not
    understand (from the documentation) how it will prevent prefetching
    when I do a

    aPerson.getHairstyle()

    I do not have a obj-property for hairstyle on person, but the relation
    are defined. Should I define the obj-property for hairstyle on person
    and use that to find a hairstyle-object in a preloaded list?

    I do understand how the preloaded hairstyles will help me when I want
    to create new persons.

      - Tore.

    On Dec 9, 2003, at 17:22, Andrus Adamchik wrote:

    > Yeah, there are some limitations when prefetching on relationships
    > defined one way. In case of lookup entities though, using a shared
    > DataContext pattern is probably a better solution anyway (it is
    > briefly mentioned here:
    > http://objectstyle.org/cayenne/userguide/datactxt/moving-objects.html
    > ) - it will save a database trip for prefetch query.
    >
    > Andrus
    >
    > On Dec 9, 2003, at 9:57 AM, Tore Halset wrote:
    >
    >> Hello!
    >>
    >> I have a database with db-relationships like:
    >>
    >> person<<-->gender
    >> person<<-->favorite color
    >> person<<-->hairstyle
    >>
    >> The obj-relationships look like
    >>
    >> person-->gender
    >> person-->favorite color
    >> person-->hairstyle
    >>
    >> I have a SelectQuery with an Expression to query for some persons. I
    >> want to prefetch in the lookup-tables for gender and hairstyle.
    >>
    >> Everything works if the obj-relationships are defined both ways, but
    >> I do not want to define them both ways. Am I doing something wrong?
    >> Is this a cayenne bug?
    >>
    >> - Tore.
    >>
    >>



    This archive was generated by hypermail 2.0.0 : Wed Dec 10 2003 - 08:42:33 EST