[Opensource] Réf. : Re: [Opensource] Timestamps and field default values

Raul DAVIDOVICH R.DAVIDOVICH at caconcology.com
Mon Nov 24 01:21:11 PST 2003


Michael,

is myObj.setField("created_date",new Date()); the preferred solution?

if yes, would it be desirable to modify AuditLog from:

public synchronized void add() throws DBException {
        // Name of this method, used for exception/debug messages
        //String thisMethod = thisClass + "add()";

        setField("AUDITLOG_DATE",
DateTime.getDateTimeForDB(this.getDataContext()));
        super.add();
    }


to:

public synchronized void add() throws DBException {
        // Name of this method, used for exception/debug messages
        //String thisMethod = thisClass + "add()";

        setField("AUDITLOG_DATE", new Date());
        super.add();
    }

?


Best regards,

---------------------------------------------------
Raul Davidovich
Responsable Informatique
Cvitkovic & Associés Consultants

(33) 1 45 15 40 68
(33) 1 45 15 40 41 Fax
-------------------------------------------------------
http://www.caconcology.com


|---------+------------------------------->
|         |           Michael Rimov       |
|         |           <rimovm at centercomp.c|
|         |           om>                 |
|         |           Envoyé par :        |
|         |           opensource-admin at jco|
|         |           rporate.com         |
|         |                               |
|         |                               |
|         |           21/11/2003 05:00    |
|         |           Veuillez répondre à |
|         |           opensource          |
|         |                               |
|---------+------------------------------->
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                                                  |
  |       Pour :    opensource at jcorporate.com                                                                                                        |
  |       cc :                                                                                                                                       |
  |       Objet :   Re: [Opensource] Timestamps and field default values                                                                             |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|




Raul,

CVS has a bugfix so you can call:

             myObj.setField("created_date",new Date());

to set a full timetamp.  RC-6 will have that. [I'm only waiting for one or
two emails verifying patches before I release it]

Otherwise, you can do:
             DateTime.getDateTimeForDB(new Date(), request.getDataContext
());

[I don't remember parameter order off hand, don't quote me on this last one

:) ]

HTH!

-Mike



_______________________________________________
Opensource mailing list
Opensource at jcorporate.com
http://mail.jcorporate.com/mailman/listinfo/opensource
Archives: http://mail.jcorporate.com/pipermail/opensource/








More information about the Opensource mailing list