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

Enable multiple column sorting on advanced queries

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 7.1.0.Final
    • None
    • None
    • NEW
    • NEW
    • 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'
    • Sprint3

    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.

      Attachments

        Activity

          People

            docmrc97 Mark Coble (Inactive)
            iwatson@redhat.com Ian Watson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: