* Fall back to property name if a filter reference can't be resolved as column name.

Fixes bug 557 <http://helma.org/bugs/show_bug.cgi?id=557>
This commit is contained in:
hns 2007-09-21 13:12:46 +00:00
parent 74b3b217ee
commit 262eb22335

View file

@ -906,12 +906,12 @@ public final class Relation {
if (columnName != null) { if (columnName != null) {
DbMapping dbmap = nonvirtual.getDbMapping(); DbMapping dbmap = nonvirtual.getDbMapping();
String propertyName = dbmap.columnNameToProperty(columnName); String propertyName = dbmap.columnNameToProperty(columnName);
if (propertyName != null) { if (propertyName == null)
propertyName = columnName;
IProperty property = nonvirtual.get(propertyName); IProperty property = nonvirtual.get(propertyName);
if (property != null) { if (property != null) {
value = property.getStringValue(); value = property.getStringValue();
} }
}
if (value == null) { if (value == null) {
if (columnName.equalsIgnoreCase(dbmap.getIDField())) { if (columnName.equalsIgnoreCase(dbmap.getIDField())) {
value = nonvirtual.getID(); value = nonvirtual.getID();