Always use directly mapped property as first choice when resolving ${column_name} in appendFilter().
Only use id/name/prototype if that doesn't give us a value.
This commit is contained in:
parent
3c8f9f8890
commit
d26b968ae8
1 changed files with 14 additions and 13 deletions
|
@ -838,13 +838,6 @@ public final class Relation {
|
||||||
Object value = null;
|
Object value = null;
|
||||||
if (columnName != null) {
|
if (columnName != null) {
|
||||||
DbMapping dbmap = nonvirtual.getDbMapping();
|
DbMapping dbmap = nonvirtual.getDbMapping();
|
||||||
if (columnName.equals(dbmap.getIDField())) {
|
|
||||||
value = nonvirtual.getID();
|
|
||||||
} else if (columnName.equals(dbmap.getNameField())) {
|
|
||||||
value = nonvirtual.getName();
|
|
||||||
} else if (columnName.equals(dbmap.getPrototypeField())) {
|
|
||||||
value = nonvirtual.getPrototype();
|
|
||||||
} else {
|
|
||||||
String propertyName = dbmap.columnNameToProperty(columnName);
|
String propertyName = dbmap.columnNameToProperty(columnName);
|
||||||
if (propertyName != null) {
|
if (propertyName != null) {
|
||||||
IProperty property = nonvirtual.get(propertyName);
|
IProperty property = nonvirtual.get(propertyName);
|
||||||
|
@ -852,6 +845,14 @@ public final class Relation {
|
||||||
value = property.getValue();
|
value = property.getValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (value == null) {
|
||||||
|
if (columnName.equals(dbmap.getIDField())) {
|
||||||
|
value = nonvirtual.getID();
|
||||||
|
} else if (columnName.equals(dbmap.getNameField())) {
|
||||||
|
value = nonvirtual.getName();
|
||||||
|
} else if (columnName.equals(dbmap.getPrototypeField())) {
|
||||||
|
value = nonvirtual.getPrototype();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// end column version
|
// end column version
|
||||||
|
|
Loading…
Add table
Reference in a new issue