Re: Mysql -> Date/Time & tracking creation/modification time

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Feb 24 2005 - 20:37:07 EST

  • Next message: Mike Kienenberger: "Re: Value Object, serialization, state: hollow"

    On Feb 24, 2005, at 3:30 PM, Fredrik Liden wrote:

    > I have one table that I'd like to track
    > the date/time entries are created and the date/time they are modified.
    >
    > For the date_created I'm thinking I could use mysql's DATETIME or
    > Timestamp and have a default now() function. Does anyone have any easy
    > way to use now() during object.updates?

    You can do it, however due to JDBC limitations (there is no way to pass
    generated value back from DB to the object), this will have negative
    impact on your performance (as you'll have to invalidate/refetch all
    updated objects right after commit).

    It should be much easier to set a timestamp property on the Java side..
    E.g. in validateForUpdate and validateForInsert of DataObject.

    Andrus



    This archive was generated by hypermail 2.0.0 : Thu Feb 24 2005 - 20:37:10 EST