• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Tracking Fields and EOF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tracking Fields and EOF


  • Subject: Re: Tracking Fields and EOF
  • From: "Ricardo Cortes" <email@hidden>
  • Date: Mon, 13 Jun 2005 12:01:31 -0400
  • Organization: Bolt

I'm already using some parts of the Wonder frameworks so I'm going to go
with Alan's suggestion of using the ERCStampedEnterpriseObject class as
I just glanced at the code and it overrides willInsert(), willDelete()
and willUpdate() accordingly and provides the created/lastModified
fields.  I appreciate all the other suggestions.

By the way, isn't modification of EOs in the validateFor() methods a
cardinal sin in the EOF world?

On Mon, 2005-06-13 at 16:33 +0200, Max Ribuoli wrote:
> It's not a good idea to use awakeFromInsertion because it's called
> everytime you insert an object into an editingContext.
> I suggest you to use validateForSave and validateForInsert:
>
> public void validateForInsert() throws
> NSValidation.ValidationException {
>      setCreationDate(new NSTimestamp());
>
>      super. validateForInsert();
> }
>
> public void validateForSave() throws NSValidation.ValidationException {
>      setModificationDate(new NSTimestamp());
>
>      super. validateForSave();
> }
>
>
>
> Max Ribuoli
>
> On Jun 13, 2005, at 16:13, WebObjects Lover wrote:
>
>
> > Hi there,
> >
> > I need to add tracking fields to my database that
> > track when a record was last updated and when a record
> > was added.  I believe I can use the awakeFromInsertion
> > method on EOCustomObject (in the superclass for all my
> > EOs) to set the time the record was added but I'm a
> > little confused how I set the date last modified time
> > automatically?  Or, is this something I need to set on
> > the EO before I save changes?  Thanks...
> >
> >
> >
> >
> >
> > __________________________________
> > Discover Yahoo!
> > Have fun online with music videos, cool games, IM and more. Check
> > it out!
> > http://discover.yahoo.com/online.html
> >  _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > Webobjects-dev mailing list      (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> >
> > This email sent to email@hidden
> >
> >
> >
>
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Tracking Fields and EOF
      • From: Max Ribuoli <email@hidden>
    • Re: Tracking Fields and EOF
      • From: Chuck Hill <email@hidden>
    • Re: Tracking Fields and EOF
      • From: Alan Ward <email@hidden>
References: 
 >Tracking Fields and EOF (From: WebObjects Lover <email@hidden>)
 >Re: Tracking Fields and EOF (From: Max Ribuoli <email@hidden>)

  • Prev by Date: Re: Tracking Fields and EOF
  • Next by Date: Re: Tracking Fields and EOF
  • Previous by thread: Re: Tracking Fields and EOF
  • Next by thread: Re: Tracking Fields and EOF
  • Index(es):
    • Date
    • Thread