From 4e47de99635a97f4086dcef9b023f73d8550f76b Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 23 Apr 2003 12:34:27 +0000 Subject: [PATCH] * Add setValue() method that allows to directly set the value and type of the property * Change the default string representation of date values to be compatible with MySQL. --- src/helma/objectmodel/db/Property.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/helma/objectmodel/db/Property.java b/src/helma/objectmodel/db/Property.java index bd513008..8e4f1ea3 100644 --- a/src/helma/objectmodel/db/Property.java +++ b/src/helma/objectmodel/db/Property.java @@ -190,7 +190,7 @@ public final class Property implements IProperty, Serializable, Cloneable { /** * * - * @return ... + * @return the property's value in its native class */ public Object getValue() { return value; @@ -199,12 +199,24 @@ public final class Property implements IProperty, Serializable, Cloneable { /** * * - * @return ... + * @return the property's type as defined in helma.objectmodel.IProperty.java */ public int getType() { return type; } + /** + * Directly set the value of this property. + */ + protected void setValue(Object value, int type) { + if (type == NODE) { + unregisterNode(); + } + this.value = value; + this.type = type; + dirty = true; + } + /** * * @@ -419,7 +431,7 @@ public final class Property implements IProperty, Serializable, Cloneable { case DATE: - SimpleDateFormat format = new SimpleDateFormat("dd.MM.yy hh:mm:ss"); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); return format.format((Date) value);