Re: createPermId in DataContext

From: Andrus (andru..bjectstyle.org)
Date: Thu Nov 14 2002 - 20:57:54 EST

  • Next message: Craig Miskell: "Re: ObjectId and objEntityName"

    At 02:29 PM 11/15/2002 +1300, Craig Miskell wrote:
    >Hi again,
    > Are you sick of me yet?

    Hey, we are discussing issues directly related to Cayenne development.
    Anyone who doesn't like it wouldn't be subscribed in the first place, right?

    >Proposal: Modify createPermId to first check if the object has a
    >TempObjectId or not. If it's temporary, proceed. If not, assume it's
    >all ok and return immediately

    +1

    I agree with "robustness" argument below.

    >How does this help:
    >1) It means we can call createPermId at an appropriate time (while
    >generating audit records).
    >2) It means that createPermId will become a more robust public API (can
    >be called with any DataObject and will gracefully handle an object with
    >an id already). Others may have other times when it is necessary to
    >force the creation of a primary key.

    >Negatives:
    >There may be bits of cayenne that assume that if an Object has a
    >Permanent ID that it has been committed to the database.

    I can't think of any of such places. In most places object is analyzed
    based on persistence state, rather than ObjectId class (except for
    createPermId), so I guess we should be safe here.

    Andrus



    This archive was generated by hypermail 2.0.0 : Thu Nov 14 2002 - 20:57:07 EST