From 26a6fb4682d7abc5fd3c1724d9736cde621dec5a Mon Sep 17 00:00:00 2001 From: hns Date: Mon, 13 Jan 2003 11:26:01 +0000 Subject: [PATCH] Always do .toLowerCase() when looking up properties by property name. This is because SystemProperties stores and delivers its keys in lower case. Fixes/works around bug 189, http://helma.org/bugs/show_bug.cgi?id=189 --- src/helma/objectmodel/db/DbMapping.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/helma/objectmodel/db/DbMapping.java b/src/helma/objectmodel/db/DbMapping.java index ff169db9..12701559 100644 --- a/src/helma/objectmodel/db/DbMapping.java +++ b/src/helma/objectmodel/db/DbMapping.java @@ -390,7 +390,9 @@ public final class DbMapping implements Updatable { return null; if (table == null && parentMapping != null) return parentMapping.propertyToColumnName (propName); - Relation rel = (Relation) prop2db.get (propName); + // FIXME: prop2db stores keys in lower case, because it gets them + // from a SystemProperties object which converts keys to lower case. + Relation rel = (Relation) prop2db.get (propName.toLowerCase()); if (rel != null && (rel.reftype == Relation.PRIMITIVE || rel.reftype == Relation.REFERENCE)) return rel.columnName; return null; @@ -415,7 +417,9 @@ public final class DbMapping implements Updatable { return null; if (table == null && parentMapping != null) return parentMapping.propertyToRelation (propName); - return (Relation) prop2db.get (propName); + // FIXME: prop2db stores keys in lower case, because it gets them + // from a SystemProperties object which converts keys to lower case. + return (Relation) prop2db.get (propName.toLowerCase()); }