• 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: EOModeling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOModeling


  • Subject: Re: EOModeling
  • From: Drew Thoeni <email@hidden>
  • Date: Sun, 11 Jan 2004 00:49:40 -0500

Like Karl, I leave them in each class (or table at the database level).

If you are using OpenBase, it defaults a timestamp (_timestamp) automatically.

Here's the code Karl spoke of. It took me a bit to figure this out when I first ran into it. The code goes into the class.java file (where class is the class name). "setLastUpdate" is an example set method in this class. Your's will be whatever you call it. In this example, the timestamp gets set when a new object is created using the class definition. If you then allow the user to edit the object on a web page, time passes. So the timestamp can be off by the difference in how long it takes the user to edit and then save the object.


public void awakeFromInsertion(EOEditingContext ec) { super.awakeFromInsertion(ec); setLastUpdate(new NSTimestamp()); }

Drew

On Jan 10, 2004, at 11:56 AM, james cicenia wrote:

First I want to thank everyone who has replied to my "newbie" thread.

I have now refactored my design to break up my "Project" table to actually
be three ala Chuck's advice.


My new question is... I like to have audit fields in my databases so that
every row is stamped with a creation date/user and last mod date/user.


Should I start a separate base object that includes these "audit" attributes
and then create a corresponding "audit" table in the database? Or, should
I just leave them as attributes in my classes and just store the attributes as
columns in the database?


thanks again.

-James
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: EOModeling
      • From: Chuck Hill <email@hidden>
    • Re: EOModeling
      • From: Ricardo Strausz <email@hidden>
References: 
 >EOModeling (From: james cicenia <email@hidden>)

  • Prev by Date: Eclipse WOLips IDE Opinions
  • Next by Date: RE: Eclipse WOLips IDE Opinions
  • Previous by thread: Re: EOModeling
  • Next by thread: Re: EOModeling
  • Index(es):
    • Date
    • Thread