OpenJPA
  1. OpenJPA
  2. OPENJPA-710

Unordered collection field adds ORDER BY clause

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0
    • Fix Version/s: 1.0.4, 1.1.1, 1.2.1, 1.3.0
    • Component/s: kernel
    • Labels:
      None

      Description

      An ORDER BY clause is added while selecting even for collection-valued fields that do not require ordering.

      For example, consider a typical Parent-Child model with bi-directional relationship where Parent.children is declared and/or initialized as a Set rather than a List will result in the following SQL
      "SELECT t0.id, t0.name, t1.id FROM PARENT t0 LEFT OUTER JOIN CHILD t1 ON t0.id = t1.PARENT_ID ORDER BY t1.PARENT_ID"
      corresponding to JPQL "select p from Parent p left join fetch p.children".

      Is ORDER BY clause necessary in this context? I
      t also adds an extra performance overhead on the SQL query execution for a fairly frequent usage pattern.

        Activity

        Pinaki Poddar created issue -
        Pinaki Poddar made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Pinaki Poddar made changes -
        Status Resolved [ 5 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Pinaki Poddar made changes -
        Component/s kernel [ 12311302 ]
        Pinaki Poddar made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Kevin Sutter added a comment -

        Added additional versions (both affects and fix).

        Show
        Kevin Sutter added a comment - Added additional versions (both affects and fix).
        Kevin Sutter made changes -
        Fix Version/s 1.1.1 [ 12313177 ]
        Affects Version/s 1.0.0 [ 12312341 ]
        Affects Version/s 1.0.2 [ 12312846 ]
        Affects Version/s 1.2.0 [ 12313102 ]
        Affects Version/s 1.0.3 [ 12312969 ]
        Fix Version/s 1.2.1 [ 12313328 ]
        Affects Version/s 1.2.1 [ 12313328 ]
        Affects Version/s 1.0.1 [ 12312687 ]
        Affects Version/s 1.3.0 [ 12313326 ]
        Affects Version/s 1.1.1 [ 12313177 ]
        Affects Version/s 1.1.0 [ 12312344 ]
        Fix Version/s 1.0.4 [ 12313301 ]
        Affects Version/s 1.0.4 [ 12313301 ]
        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        3h 13m 1 Pinaki Poddar 03/Sep/08 01:27
        Resolved Resolved Reopened Reopened
        6s 1 Pinaki Poddar 03/Sep/08 01:28
        Reopened Reopened Resolved Resolved
        1m 1s 1 Pinaki Poddar 03/Sep/08 01:29
        Resolved Resolved Closed Closed
        552d 18h 3m 1 Donald Woods 09/Mar/10 18:32

          People

          • Assignee:
            Pinaki Poddar
            Reporter:
            Pinaki Poddar
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development