Uploaded image for project: 'Torque'
  1. Torque
  2. TORQUE-178

Change semantics of add() and or() methods in Criteria

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0-beta1
    • Runtime, Templates
    • None

    Description

      In my opinion, the Criteria.add() and Criteria.or() method behave counter-intuitively. My opinion of an intuitive behaviour would be:

      • Criteria.or(someCondition) should result in a where clause which contains ((whatever was in the where condition before) OR someCondition)
      • Criteria.add(someCondition) should result in a where clause which contains ((whatever was in the where condition before) AND someCondition), i.e. the same as Criteria.and(someCondition)

      Instead, the behaviour is now

      • Criteria.or(someCondition) only or's the new condition with any existing condition(s) that affects the same column.
      • Criteria.add(someCondition) replaces any existing condition(s) that affects the same column with the new condition.

      Attachments

        Activity

          People

            tfischer Thomas Fox
            tfischer Thomas Fox
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: