Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3145

Refactor toSQL method as visitor pattern

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.4
    • Component/s: JAX-RS
    • Labels:
      None
    • Estimated Complexity:
      Moderate

      Description

      In doing some work with the FIQL parser, I needed to generate a different output than SQL. By using a visitor pattern for rendering the SQL, any visitor can be applied to the SearchCondition object graph.

      The attached patch provides that refactoring.

      As a part of that, SearchCondition.toSql() is deprecated, but I maintained the interface for maximum compatibility.

      There was also a change to SearchCondition.getSearchConditions(). There were no callers to that code except test code, and it was set up to return null if there was only one condition. That wasn't clear to me, hopefully that change is not unreasonable.

      This may not be formatted properly, please adjust to suit.

        Attachments

        1. cxf3145.patch
          17 kB
          Brian Topping

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              topping Brian Topping
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: