Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-10298

Fluent API Bug in getFieldList()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Release Branch 18.12, Release Branch 17.12, Trunk
    • 17.12.01, 18.12.01
    • framework
    • None
    • OFBiz Community Day (Feb 2020)

    Description

      In EntityQuery the method getFieldList() uses the class variable distinct to decide if the list of genericValues should be stored in a set to eliminate duplicate values. This variable is set by the function distinct() and normally it should only be used for the sql statement. But here the flag gets mistreated since, if the list of values was ordered because of orderBy(), the order of values gets lost by putting them into a set. To summarize, the following statement:

      ....orderBy("...").dinstinct().getFieldLlist("...");

      does not produce an ordered list.

      Replacing the HashSet by a LinkedHashSet fixes this issue.

      Attachments

        Activity

          People

            mbrohl Michael Brohl
            bjugl Benjamin Jugl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: