Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1225

Improve query result processing with composite pattern

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-M3
    • Component/s: query
    • Labels:
      None

      Description

      Query result data are packed into user-visible forms by a ResultPacker.
      The logic of data packing is limited to certain extent.
      This limitation is obvious if the query projection contains multiple constructor terms e.g.
      "select new foo(p.name, p.age), Bar(p.age, p.name) from PObject p"

      The limitation is further highlighted with new (and rather hairy) specification on result processing in JPA 2.0 via introduction of several methods related to selection of projection terms namely select(), multiselect(), array(), tuple(), constructor(). In fact, JavaDoc for CriteriaQuery.multiselect() is a fine example of an API design following 'design-by-committee' approach.

      Data packing result need to improve. The solution is made difficult because
      a) it is risky to change the input data structures (the projection terms, aliases held by QueryExpressions) as they will have wide impact on query formation.
      b) this new data packing should not impact the JPQL based queries or their result processing.
      c) ResultPacker is an implementation not an interface.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ppoddar@apache.org Pinaki Poddar
                Reporter:
                ppoddar@apache.org Pinaki Poddar
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 168h
                  168h
                  Remaining:
                  Remaining Estimate - 168h
                  168h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified