trivial patch to ModelViewEntity class to make view entity able to handle
entity condition between field from one entity and another
------------------------------------------------------------------------------------------------------------------------------------
Key: OFBIZ-4321
URL: https://issues.apache.org/jira/browse/OFBIZ-4321
Project: OFBiz
Issue Type: Bug
Components: framework
Affects Versions: SVN trunk
Reporter: Leon
Priority: Minor
Fix For: SVN trunk
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:
{code:xml}
<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>
{code}
But there's a trivial defect in current ModelViewEntity which prevent this case
working.
{code:java}
} else if ( value == null &&
(operator.equals(EntityOperator.EQUALS) ||
operator.equals(EntityOperator.NOT_EQUAL))) {
return EntityCondition.makeCondition(lhs,
UtilGenerics.<EntityComparisonOperator<?,?>>cast(operator), null);
} else {
{code}
In the above code extracted from ModelViewEntity, it does not consider the
condition that the relField could be defined when value==null.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira