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
This commit is contained in:
parent
a0beacdf4c
commit
26a6fb4682
1 changed files with 6 additions and 2 deletions
|
@ -390,7 +390,9 @@ public final class DbMapping implements Updatable {
|
||||||
return null;
|
return null;
|
||||||
if (table == null && parentMapping != null)
|
if (table == null && parentMapping != null)
|
||||||
return parentMapping.propertyToColumnName (propName);
|
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))
|
if (rel != null && (rel.reftype == Relation.PRIMITIVE || rel.reftype == Relation.REFERENCE))
|
||||||
return rel.columnName;
|
return rel.columnName;
|
||||||
return null;
|
return null;
|
||||||
|
@ -415,7 +417,9 @@ public final class DbMapping implements Updatable {
|
||||||
return null;
|
return null;
|
||||||
if (table == null && parentMapping != null)
|
if (table == null && parentMapping != null)
|
||||||
return parentMapping.propertyToRelation (propName);
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue