Re: Is there an awakeFromInsertion equivalent in cayenne?

From: Bryan Lewis (brya..aine.rr.com)
Date: Mon Oct 30 2006 - 14:53:18 EST

  • Next message: Michael Gentry: "Re: Re: Is there an awakeFromInsertion equivalent in cayenne?"

    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 - 15:20:27 EST