• 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: Updating EO by inserting new EO and archiving the old EO - any suggestions?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updating EO by inserting new EO and archiving the old EO - any suggestions?


  • Subject: Re: Updating EO by inserting new EO and archiving the old EO - any suggestions?
  • From: Amiel Montecillo <email@hidden>
  • Date: Tue, 26 Jan 2010 08:05:06 +0800

Once again, thank you for your ideas. Going to increase my caffeine intake now.

Amiel

On Tue, Jan 26, 2010 at 4:24 AM, Chuck Hill <email@hidden> wrote:

On Jan 25, 2010, at 12:32 AM, Amiel Montecillo wrote:

Hi List,

I am having a dilemma on how to best implement this kind of scenario.

I need the update process of an EO by creating an new EO with the updated values and archiving the old one. This EO has quiet a few to-many relationships that needs to be archived as well.

I am thinking of copying the existing values along with the relationship values to an NSDictionary and tie that to the form. Once the save action fires, inspect if there are any changed values and create a new EO with the updated values and archive the old one.

Can anyone suggest a better way of handling this?

Use the EOCopying code from Practical WebObjects.  If you want to edit eo, instead edit eo.copy().  The copy() method should mark the existing object as archived.  If the user saves, the existing object will be saved marked as archived, and new objects will be created.  You will need to handle how these objects are referenced in relationships so you don't show archived versions.

The GVCGenericObjects framework shows one way of doing this, though it is NOT intended for use as an audit trail.
http://www.global-village.net/chill/gvc_frameworks


There have been several good discussions on various audit trail implementations on the list.  Search for "audit trail".  You need to carefully evaluate your requirements and choose your implementation accordingly.


Chuck

--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects










--
socket error: unable to connect to 127.0.0.1
 _______________________________________________
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

References: 
 >Updating EO by inserting new EO and archiving the old EO - any suggestions? (From: Amiel Montecillo <email@hidden>)
 >Re: Updating EO by inserting new EO and archiving the old EO - any suggestions? (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: ertaggable not migrating
  • Next by Date: Re: ertaggable not migrating
  • Previous by thread: Re: Updating EO by inserting new EO and archiving the old EO - any suggestions?
  • Next by thread: Error Message in Eclipse
  • Index(es):
    • Date
    • Thread