OFBiz
  1. OFBiz
  2. OFBIZ-3151

fix for using "equals" operator with null field in performFind service.

    Details

    • Type: Improvement Improvement
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Trunk
    • Component/s: framework
    • Labels:
      None

      Description

      Because I can not use "equals" operator with null field in performFind service. So I fixed for use one.

        Activity

        Hide
        Jacques Le Roux added a comment -

        Morevoer, as said Scott I wonder if this really works. The representation of GenericEntity.NULL_FIELD is "[null-field]" and not "nullField".

        I will test before reverting...

        Show
        Jacques Le Roux added a comment - Morevoer, as said Scott I wonder if this really works. The representation of GenericEntity.NULL_FIELD is " [null-field] " and not "nullField". I will test before reverting...
        Hide
        Jacques Le Roux added a comment -

        Chatree, Scott,

        Yes, but what if someone prefer "null" tomorrow, etc.? Should we not avoid redundancy which we now may lead to inconsistency?
        And I'm sure one day someone whill ask the differnce between nullField and empty...

        I'd prefer to revert

        Show
        Jacques Le Roux added a comment - Chatree, Scott, Yes, but what if someone prefer "null" tomorrow, etc.? Should we not avoid redundancy which we now may lead to inconsistency? And I'm sure one day someone whill ask the differnce between nullField and empty... I'd prefer to revert
        Hide
        Scott Gray added a comment -

        Hi Chatree,

        Does that actually work though? As far as I can tell the string representation of GenericEntity.NULL_FIELD is "[null-field]" and not "nullField".

        Assuming it does work, is it really worth adding something that is more verbose than the existing method but achieves the exact same thing?
        Do you really prefer:
        <set field="parameters.statusId" from-field="nullField"/> <!-- or [null-field] -->
        <set field="parameters.statusId_op" value="equals"/>
        over this:
        <set field="parameters.statusId_op" value="empty"/>

        If you do that is fine, go ahead and leave it in there, it's entirely up to you and Hans.

        Show
        Scott Gray added a comment - Hi Chatree, Does that actually work though? As far as I can tell the string representation of GenericEntity.NULL_FIELD is " [null-field] " and not "nullField". Assuming it does work, is it really worth adding something that is more verbose than the existing method but achieves the exact same thing? Do you really prefer: <set field="parameters.statusId" from-field="nullField"/> <!-- or [null-field] --> <set field="parameters.statusId_op" value="equals"/> over this: <set field="parameters.statusId_op" value="empty"/> If you do that is fine, go ahead and leave it in there, it's entirely up to you and Hans.
        Hide
        Chatree Srichart added a comment -

        Hi Scott, Jacques

        using "empty" is work fine but I think

        ....
        <set field="parameters.statusId" from-field="nullField"/>
        <set field="parameters.statusId_op" value="equals"/>
        ....

        should work too.
        If you do not think about that, I am OK.

        Regards,
        Chatree

        Show
        Chatree Srichart added a comment - Hi Scott, Jacques using "empty" is work fine but I think .... <set field="parameters.statusId" from-field="nullField"/> <set field="parameters.statusId_op" value="equals"/> .... should work too. If you do not think about that, I am OK. Regards, Chatree
        Hide
        Hans Bakker added a comment -

        we missed your message scott and we wil look into it....

        Regards,
        Hans

        Show
        Hans Bakker added a comment - we missed your message scott and we wil look into it.... Regards, Hans
        Hide
        Jacques Le Roux added a comment -

        +1 on Scott's comment

        Show
        Jacques Le Roux added a comment - +1 on Scott's comment
        Hide
        Scott Gray added a comment -

        Jira issues and patches are pretty pointless if reviews and comments are going to be ignored

        Show
        Scott Gray added a comment - Jira issues and patches are pretty pointless if reviews and comments are going to be ignored
        Hide
        Jacques Le Roux added a comment -

        Hi Hans, Chatree,

        So "empty" did not work ?

        Show
        Jacques Le Roux added a comment - Hi Hans, Chatree, So "empty" did not work ?
        Hide
        Hans Bakker added a comment -

        Thanks for your contribution, Committed revision 883525.

        Show
        Hans Bakker added a comment - Thanks for your contribution, Committed revision 883525.
        Hide
        Jacques Le Roux added a comment -

        Hi Chatree,

        Should we close ?

        Show
        Jacques Le Roux added a comment - Hi Chatree, Should we close ?
        Hide
        Scott Gray added a comment -

        Have you tried this:
        <set field="parameters.statusId_op" value="empty"/>

        Show
        Scott Gray added a comment - Have you tried this: <set field="parameters.statusId_op" value="empty"/>
        Hide
        Chatree Srichart added a comment - - edited

        I would like to look up parties which have empty statusId field.
        I use performFind service included condition...
        ....
        <set field="parameters.statusId" from-field="nullField"/>
        <set field="parameters.statusId_op" value="equals"/>
        ....
        <service service-name="performFind" result-map="result" result-map-list="listIt">
        <field-map field-name="inputFields" from-field="parameters"/>
        ....

        But It doesn' t accepted anything.

        Show
        Chatree Srichart added a comment - - edited I would like to look up parties which have empty statusId field. I use performFind service included condition... .... <set field="parameters.statusId" from-field="nullField"/> <set field="parameters.statusId_op" value="equals"/> .... <service service-name="performFind" result-map="result" result-map-list="listIt"> <field-map field-name="inputFields" from-field="parameters"/> .... But It doesn' t accepted anything.
        Hide
        Jacques Le Roux added a comment -

        Hi Chatree,

        Could you explain please how you use null field in performFind service ?

        Show
        Jacques Le Roux added a comment - Hi Chatree, Could you explain please how you use null field in performFind service ?

          People

          • Assignee:
            Jacques Le Roux
            Reporter:
            Chatree Srichart
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development