Re: Is there an awakeFromInsertion equivalent in cayenne?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Oct 30 2006 - 17:08:12 EST

  • Next message: Dov Rosenberg: "Transition from EOF to Cayenne"

    > but I believe Andrus mentioned
    > there'd be other ways of doing it in 3.0

    Yes - and this seems to be the killer feature in 3.0 - it's been
    discussed like a dozen times in the past month. Here is a few links:

    http://cwiki.apache.org/CAYDOC/lifecycle-callbacks.html
    http://objectstyle.org/cayenne/lists/cayenne-devel/2006/10/0112.html

    Andrus

    On Oct 30, 2006, at 3:35 PM, Michael Gentry wrote:

    > setPersistenceState is what I use, too, but I believe Andrus mentioned
    > there'd be other ways of doing it in 3.0 and I believe there were some
    > ROP issues with it, too. If you aren't using ROP, you should be fine.
    >
    > /dev/mrg
    >
    >
    > On 10/30/06, Bryan Lewis <brya..aine.rr.com> wrote:
    >> Not directly. When we converted our old WebObjects apps, we made a
    >> custom superclass that hooks setPersistenceState():
    >>
    >> /**
    >> * When any of our objects is inserted, call a method
    >> * awakeFromInsertion() to allow the object class to do
    >> initialization.
    >> */
    >> public void setPersistenceState(int state)
    >> {
    >> super.setPersistenceState(state);
    >>
    >> if (state == PersistenceState.NEW) {
    >> awakeFromInsertion();
    >> }
    >> }
    >>
    >> /**
    >> * The default behavior for awakeFromInsertion() is to do
    >> nothing.
    >> */
    >> public void awakeFromInsertion()
    >> {
    >> }
    >>
    >>
    >>
    >>
    >>
    >> Watkins, Garry wrote:
    >> > I need to set up some default values. Is there an equivalent to
    >> > awakeFromInsertion (WebObjects) for Cayenne?
    >> >
    >> > Thanks
    >> >
    >>
    >>
    >



    This archive was generated by hypermail 2.0.0 : Mon Oct 30 2006 - 17:08:35 EST