[Helma-user] ORM of timestamp and datetime DB fields
Marius Lessiak
marius.lessiak at oewa.at
Tue Jan 16 16:36:39 CET 2007
forgot to mention: using the latest helma build version 1.5.3 with
mysql-connector-java-5.0.4-bin.jar and mysql 5.0.30.
cheers,
marius
Marius Lessiak schrieb:
> hello,
>
> i'm trying to insert a new HopObject into the database. the type is
> "site" and the type.properties are:
> ----------
> _db = stat2
> _table = site
>
> _id = site_id
> _parent = root
> _name = site_szmname
>
> szmname = site_szmname
> shortname = site_shortname
> longname = site_longname
> extreport_active = site_extreport_active
> lu = site_lu
> ct = site_ct
> del = site_del
> ----------
>
> properties lu (lastupdate) and ct (createtime) are of type TIMESTAMP in
> the mysql database (version 5.0.30). i try to insert a new site object
> with the following code:
>
> ----------
> var newSite = new site();
> newSite.szmname = param.szmname;
> newSite.shortname = param.shortname;
> newSite.longname = param.longname;
> newSite.extreport_active = 1;
> newSite.del = 0;
> newSite.lu = "2007-01-01 11:11:00";
> newSite.ct = "20070116162320";
> root.add(newSite);
> ----------
>
> All properties of the new site entry get written to the database EXCEPT
> for lu and ct which are of type TIMESTAMP. instead of the proper values
> helma stores NULL into the db. i played around a bit and found out that:
>
> *) setting the mysql type to DATETIME makes no difference
> *) setting it to VARCHAR(255) results in helma suddenly storing the
> proper values
>
> so is helma not capable of storing TIMESTAMP values in the mysql db or
> am i missing something?
>
> tia and cheers,
> marius
>
--
Marius Lessiak, Bakk.techn.
Tel: +43 (0) 1 512 88 66 - 17
Fax: +43 (0) 1 512 88 66 - 22
E-Mail: marius.lessiak at oewa.at
Web: http://www.oewa.at
More information about the Helma-user
mailing list