RE: CayenneDataObject

From: Gentry, Michael (michael_gentr..anniemae.com)
Date: Thu Jun 24 2004 - 10:28:41 EDT

  • Next message: Sako!: "Re: read Row"

    When you fetch an object from the database, the entire object is
    populated (at least what values you have specified in the entity). You
    don't want to have database round-trips on each get method -- the
    performance would be horrible.

    Can I ask why you are wanting to delay the fetching of certain values?
    The only thing I can think of offhand is you have BLOBs (or similar)
    that you are wanting to defer until needed. If this is the case, it is
    usually better modeled as a to-one relationship to another table which
    stores only your BLOBs (that table contains a key for the join and the
    BLOB itself). This way, you don't fetch it unless you need it, but you
    have the meta-type information available in the parent entity.

    For example, if you were storing pictures in the database, you might
    have one table that contains the name of the picture, a description,
    date uploaded, file type, file size, maybe a small thumbnail, etc., but
    then have a join to the image table which is where all the full-size
    images are stored. That way, you could display a preview page with a
    bunch of small thumbnail images, but not actually load the full-size
    image unless needed.

    Hope that helps,

    /dev/mrg

    -----Original Message-----
    From: Elia Morling [mailto:eli..amiljen.se]
    Sent: Wednesday, June 23, 2004 6:34 PM
    To: cayenne-use..bjectstyle.org
    Subject: CayenneDataObject

    Greetings,

    When are values loaded into the CayenneDataObject when there is
    a corresponding row of data in the database? With the constructor or on
    each getMethod? Are the values persistant?

    I would like to configure this for each value. Some values should
    persist, others
    shouldn't. Some values should be retrieved when the CayenneDataObject is

    retrieved in a query and others when their get method is called.

    Is this possible?

    Thanks for your time.
    Elia



    This archive was generated by hypermail 2.0.0 : Thu Jun 24 2004 - 10:28:46 EDT