In view entity definition, we can use <condition-expr> to create a filter condition between field and some value using specific operator. It should be also possible to make condition between field and rel-field through some kind operator. Such as:
<view-entity entity-name="xxx" package-name="xxx">
...
<entity-condition>
<condition-expr entity-alias="A" field-name="a" operator="equals" rel-entity-alias="B" rel-field-name="b" />
</entity-condition>
</view-entity>
But there's a trivial defect in current ModelViewEntity which prevent this case working.
} else if ( value == null && (operator.equals(EntityOperator.EQUALS) || operator.equals(EntityOperator.NOT_EQUAL))) {
return EntityCondition.makeCondition(lhs, UtilGenerics.<EntityComparisonOperator<?,?>>cast(operator), null);
} else {
In the above code extracted from ModelViewEntity, it does not consider the condition that the relField could be defined when value==null.
JLR:I checked that || should not be used in <<value == null && this.relFieldName>>, it was not obvious to me but is correct
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1137201 13f79535-47bb-0310-9956-ffa450edef68