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,19 +838,20 @@ public final class Relation {
|
|||
Object value = null;
|
||||
if (columnName != null) {
|
||||
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);
|
||||
if (propertyName != null) {
|
||||
IProperty property = nonvirtual.get(propertyName);
|
||||
if (property != null) {
|
||||
value = property.getValue();
|
||||
}
|
||||
String propertyName = dbmap.columnNameToProperty(columnName);
|
||||
if (propertyName != null) {
|
||||
IProperty property = nonvirtual.get(propertyName);
|
||||
if (property != null) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue