forcing object update

From: Cris Daniluk (cris.danilu..mail.com)
Date: Wed Sep 28 2005 - 09:31:36 EDT

  • Next message: Andrus Adamchik: "Re: forcing object update"

    I'm writing a small webapp that binds the objects directly to forms -
    for the most part, its working great, but I'm having a bit of trouble
    maintaining a many-to-many relationship across a flattened table with
    a multi-select box. Because the framework doesn't know a removed
    relationship from omitted data, and because it will happily readd the
    same one a thousand times, I had to hack around a little.

    Basically, I added a separate property in the wrapper object to store
    the list of related objects outside of Cayenne, move the persistence
    state to MODIFIED, and then use a validateOnInsert() method to re-sync
    the transient property with the Cayenne property. Unfortunately,
    Cayenne is outsmarting me - because the snapshots have not changed,
    commitChanges() reverts to COMMITTED.

    Is there a way I can force Cayenne to attempt to commit this object?
    Or, better, a native way to take a NEW list of objects in a
    relationship and have Cayenne decide what should be tossed and what
    should be kept...

    Thanks,

    Cris



    This archive was generated by hypermail 2.0.0 : Wed Sep 28 2005 - 09:31:41 EDT