Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Bug report: Constructor of AdvancedCriteria(OperatorId operator) does not us

    Hello Isomorphic,

    please see the server-side results for these two calls of the current nightly (v9.0p_2013-10-28/EVAL Deployment):
    1st, anonymous subclass, with bug:
    Code:
    fetchData(new AdvancedCriteria([B]OperatorId.OR[/B]) {
    	{
    		addCriteria(new Criterion("TENANT_ID", OperatorId.EQUALS, 1));
    		addCriteria(new Criterion("TENANT_ID", OperatorId.EQUALS, 0));
    	}
    });
    2nd, no anonymous subclass (other constructor), no bug:
    Code:
    fetchData(new AdvancedCriteria([B]OperatorId.OR[/B], new Criterion[] { new Criterion("TENANT_ID", OperatorId.EQUALS, 1),
    		new Criterion("TENANT_ID", OperatorId.EQUALS, 0) }));
    On the server-side I get the Criteria via DMI for the DS:
    Code:
    AdvancedCriteria oldAc = dsRequest.getAdvancedCriteria();
    In the 1st case, oldAC is "AdvancedCriteria:[and:[null, {TENANT_ID equals 1}, {TENANT_ID equals 0}]]",
    in the 2nd case it is the expected "AdvancedCriteria:[or:[{TENANT_ID equals 1}, {TENANT_ID equals 0}]]".

    Could you please confirm?

    Best regards,
    Blama
    Last edited by Blama; 28 Oct 2013, 08:05.

    #2
    Hello Blama,
    We've fixed the issue with null value in criteria list - please pick up the next nightly or 4.0 build (dated Nov 7 or above) to get this fix.
    As for criteria operator change from 'or' to 'and' in your example - this is expected behaviour.
    See javadoc to addCriteria method:
    Code:
    Adds a new criteria. 
    If the present criteria operation is "and", the new criteria is appended to the criteria list. 
    Otherwise, the present criteria is replaced with an "and" criteria, with two sub-criteria: the present criteria, and the passed criteria.
    So criteria was replaced with an "and" criteria in your example.

    Regards
    Isomorphic Software

    Comment


      #3
      Hi Isomorphic,

      thanks for fixing, I'll try with the new nightly.

      Best regards,
      Blama

      Comment

      Working...
      X