Re: Bean properties

From: Cris Daniluk (cris.danilu..mail.com)
Date: Tue May 31 2005 - 09:24:02 EDT

  • Next message: Cris Daniluk: "Re: update and insert events"

    writeProperty/readProperty won't get invoked for relationships, which
    is probably a good thing since you'd want separate handling in those
    cases. Check out setToOneTarget, addToManyTarget, etc for handling
    relationships.

    This is probably exactly what you want to do. The only alternative
    that comes to my mind is to take a look at an event listener (like the
    DataView stuff) and/or overriding validateOnSave to defer your
    firePropertyChange to the actual save. You can compare
    getCurrentSnapshot and getCommittedSnapshot and fire the events all at
    once. Something along those lines would let you only fire on committed
    changes. Otherwise, what you've got is fine.

    Cris

    On 5/31/05, Marko Kocic <marko.koci..mail.com> wrote:
    > Hi all,
    > I'm writing desktop a application using cayenne. I wand my DataObject
    > classes to adhere to JavaBean specification.
    > I subclasses CayenneDataObject class and overrided writeProperty
    > method to fire property change event. Do I have to override something
    > else too?
    > Is it generally a good idea, or is there something built-in that I
    > could use? It works for me now, but I havent tested it yet with
    > relationships.
    >



    This archive was generated by hypermail 2.0.0 : Tue May 31 2005 - 09:24:03 EDT