Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-50179

DefaultActionableDynamicQuery does not honor order criteria

    Details

      Description

      In method doPerformActions() of DefaultActionableDynamicQuery lines 256-261 the code states:

      dynamicQuery.add(property.gt(previousPrimaryKey));
      
      dynamicQuery.addOrder(OrderFactoryUtil.asc(_primaryKeyPropertyName));
      
      dynamicQuery.setLimit(0, _interval);
      

      Presumably this is done to paginate the results in batches of rows of size _interval.

      The problem with this technique is that it invalidates any ordering the user may have added to the ActionableDynamicQuery. This is because the ordering on the primary key always takes precedence.

      Right we do not use the addOrder method of ActionableDynamicQuery but it is a public API.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 years, 8 weeks, 6 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP25
                  7.0.X EE
                  7.0.4 CE GA5
                  Master