Return-Path: Delivered-To: apmail-incubator-cayenne-user-archive@locus.apache.org Received: (qmail 399 invoked from network); 30 Oct 2006 22:08:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2006 22:08:35 -0000 Received: (qmail 24900 invoked by uid 500); 30 Oct 2006 22:08:45 -0000 Delivered-To: apmail-incubator-cayenne-user-archive@incubator.apache.org Received: (qmail 24885 invoked by uid 500); 30 Oct 2006 22:08:45 -0000 Mailing-List: contact cayenne-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cayenne-user@incubator.apache.org Delivered-To: mailing list cayenne-user@incubator.apache.org Received: (qmail 24876 invoked by uid 99); 30 Oct 2006 22:08:45 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Oct 2006 14:08:45 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [64.124.179.102] (HELO polatsk.objectstyle.org) (64.124.179.102) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 30 Oct 2006 14:08:33 -0800 Received: (qmail 9327 invoked from network); 30 Oct 2006 22:08:12 -0000 Received: from unknown (HELO ?ZJ?????IPv6:::1?) (127.0.0.1) by localhost with SMTP; 30 Oct 2006 22:08:12 -0000 Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: References: <4546582E.5020903@maine.rr.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Andrus Adamchik Subject: Re: Is there an awakeFromInsertion equivalent in cayenne? Date: Mon, 30 Oct 2006 17:08:12 -0500 To: cayenne-user@incubator.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org > 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 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 >> > >> >> >