Commons DbUtils
  1. Commons DbUtils
  2. DBUTILS-114

Order of columns not retained in BasicRowProcessor with HashMap

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Labels:
      None

      Description

      The CaseInsensitiveHashMap extends HashMap. This means that the order of columns defined in a select query is not retained when one wants to iterate over the entry set. This be changed to LinkedHashMap.

      1. DBUTILS-114.patch
        0.9 kB
        Michael Osipov

        Activity

        Hide
        Michael Osipov added a comment -

        Simple patch fixed this issue.

        Show
        Michael Osipov added a comment - Simple patch fixed this issue.
        Hide
        Benedikt Ritter added a comment -

        How do you feel about changing the name of the extension to CaseInsensitiveLinkedHashMap as well?

        Show
        Benedikt Ritter added a comment - How do you feel about changing the name of the extension to CaseInsensitiveLinkedHashMap as well?
        Hide
        Michael Osipov added a comment - - edited

        Actually, there are two options:

        1. CaseInsensitiveMap
        2. CaseInsensitiveLinkedHashMap

        I favor the first because it describes the contract but the actual implementation is not of interest, in my opinion.

        Have a look at Commons Collections.

        Show
        Michael Osipov added a comment - - edited Actually, there are two options: 1. CaseInsensitiveMap 2. CaseInsensitiveLinkedHashMap I favor the first because it describes the contract but the actual implementation is not of interest, in my opinion. Have a look at Commons Collections .
        Hide
        Benedikt Ritter added a comment -

        Fixed in r1611088. Thanks for the patch!

        Show
        Benedikt Ritter added a comment - Fixed in r1611088. Thanks for the patch!

          People

          • Assignee:
            Benedikt Ritter
            Reporter:
            Michael Osipov
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development