Re: Track changes of a dataobjects property

From: Mike Kienenberger (mkienen..laska.net)
Date: Fri Apr 22 2005 - 10:54:54 EDT

  • Next message: Mike Kienenberger: "Re: Null Pointer error"

    Cris Daniluk <cris.danilu..mail.com> wrote:
    > You can access the snapshot and compare directly... not sure if that
    > works for you or not. getCommittedSnapshot() and getCurrentSnapshot()
    > can give you the differences.
    >
    > There's also the un-documented but very present FieldValueChangeEvent
    > that you could use. Just register it in the DataView, and then use it
    > to collect the modifications for later review. It's a funky way to get
    > to what you want, but if you need more realtime access to property
    > changes, it's an elegant way to do it.
    >
    > A slightly more intuitive but less cool way to do it is to just change
    > the superclass you use from CayenneDataObject to your own, and wrap
    > writeProperty.
    >
    > Still, from the sounds of what you're doing, the snapshot should be
    > all you need...

    I think another possibility is to set a DataContext delegate and monitor
    shouldMergeChanges().
    This will provide you with a snapshot of the fields that are changing.



    This archive was generated by hypermail 2.0.0 : Fri Apr 22 2005 - 10:53:16 EDT