Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-5468

Enable multiple column sorting on advanced queries

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 7.1.0.Final
    • Component/s: None
    • Labels:
    • Sprint:
      Sprint3
    • Release Notes Text:
      Hide
      The current implementation of the QueryService used in executing advanced queries only supports sorting with ORDER BY clauses having the following pattern:

      ORDER BY column1, column2, ... ASC|DESC;

      which limits the sorting to either ascending or descending for all columns.

      Desired behaviour is that of a full ORDER BY clause:

      ORDER BY Column1 ASC|DESC, Column2 ASC|DESC, ..., ColumnN ASC|DESC;

      allowing sort order per column.

      Without a QueryParamBuilder the QueryFilterSpec is used for inclusive column filtering. The ORDER BY capability is also limited as above for these types of advanced queries.

      Solution:

      QueryContext currently provides simple pagination and sorting criteria. While it is appropriate to be used with JPQL query definitions such as those used by RuntimeDataServiceBase it is imposes the limitations described above for the advanced queries.

      The following changes were applied:

      droolsjbpm/droolsjbpm-knowledge

      + AdvancedQueryContext: Subclass of QueryContext having additional String property reprsenting the order by clause: "Column1 ASC|DESC, Column2 ASC|DESC, ..., ColumnN ASC|DESC"

      droolsjbpm/jbpm/jbpm-services/jbpm-kie-services

      M QueryServiceImpl(QueryService) refactored methods implementing advanced queries to use AdvancedQueryContext.

      droolsjbpm\droolsjbpm-integration\

      M QueryDataServiceBase added checks for full order by clause in the payload
      M KieServerConstants: added constant value QUERY_ORDER_BY_CLAUSE
      M QueryFilterSpec added orderByClause property
      M QueryDataResource corrected misnamed 'sortBy' param to 'orderBy'
      Show
      The current implementation of the QueryService used in executing advanced queries only supports sorting with ORDER BY clauses having the following pattern: ORDER BY column1, column2, ... ASC|DESC; which limits the sorting to either ascending or descending for all columns. Desired behaviour is that of a full ORDER BY clause: ORDER BY Column1 ASC|DESC, Column2 ASC|DESC, ..., ColumnN ASC|DESC; allowing sort order per column. Without a QueryParamBuilder the QueryFilterSpec is used for inclusive column filtering. The ORDER BY capability is also limited as above for these types of advanced queries. Solution: QueryContext currently provides simple pagination and sorting criteria. While it is appropriate to be used with JPQL query definitions such as those used by RuntimeDataServiceBase it is imposes the limitations described above for the advanced queries. The following changes were applied: droolsjbpm/droolsjbpm-knowledge + AdvancedQueryContext: Subclass of QueryContext having additional String property reprsenting the order by clause: "Column1 ASC|DESC, Column2 ASC|DESC, ..., ColumnN ASC|DESC" droolsjbpm/jbpm/jbpm-services/jbpm-kie-services M QueryServiceImpl(QueryService) refactored methods implementing advanced queries to use AdvancedQueryContext. droolsjbpm\droolsjbpm-integration\ M QueryDataServiceBase added checks for full order by clause in the payload M KieServerConstants: added constant value QUERY_ORDER_BY_CLAUSE M QueryFilterSpec added orderByClause property M QueryDataResource corrected misnamed 'sortBy' param to 'orderBy'
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      Currently the QueryContext only allows sorting ascending / descending to be applied across all columns.

      For example sort by column 1 ascending, column 2 ascending.

      Instead the ability to sort column specific should be implemented. i.e. column 1 ascending, column 2 descending.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                docmrc97 Mark Coble
                Reporter:
                ianwatson Ian Watson
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: