OpenJPA
  1. OpenJPA
  2. OPENJPA-1195

Allow datastore function as query expression

    Details

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

      Description

      Create a query expression that uses a datastore function such as MOD(..) or MAX(..) in a generic fashion.

      This is required by function() support for CriteriaQuery and adds a generic capability for queries so we can query something like

      "select CURRENT_USER(), x.name FROM Person x WHERE LENGTH(x.name)>10 ORDER BY LENGTH(x.name)"

      Notice that JPQL Parser may not like the syntax – but CriteriaQuery will allow such possibility.

      Allow the function() to accept 0 or more arguments as expressions.

        Issue Links

          Activity

          Pinaki Poddar created issue -
          Pinaki Poddar made changes -
          Field Original Value New Value
          Link This issue is part of OPENJPA-1013 [ OPENJPA-1013 ]
          Pinaki Poddar made changes -
          Link This issue is part of OPENJPA-1152 [ OPENJPA-1152 ]
          Milosz Tylenda made changes -
          Link This issue relates to OPENJPA-273 [ OPENJPA-273 ]
          Hide
          Milosz Tylenda added a comment -

          Patrick investigated a similar feature in OPENJPA-273.

          Show
          Milosz Tylenda added a comment - Patrick investigated a similar feature in OPENJPA-273 .
          Pinaki Poddar made changes -
          Fix Version/s 2.0.0 [ 12314019 ]
          Affects Version/s 2.0.0 [ 12314019 ]
          Component/s query [ 12311309 ]
          Hide
          Pinaki Poddar added a comment -

          Thanks for pointing this out.
          While we need JPQL grammar to be extended to get similar feature – this one is part of CriteriaQuery API.
          The new kernel level expression and update for variable-length function argument introduced by this current issue, perhaps, will be useful in JPQL case too, if we decide to extend the grammar.

          Show
          Pinaki Poddar added a comment - Thanks for pointing this out. While we need JPQL grammar to be extended to get similar feature – this one is part of CriteriaQuery API. The new kernel level expression and update for variable-length function argument introduced by this current issue, perhaps, will be useful in JPQL case too, if we decide to extend the grammar.
          Pinaki Poddar made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Donald Woods made changes -
          Fix Version/s 2.0.0-M3 [ 12314148 ]
          Fix Version/s 2.0.0 [ 12314019 ]
          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
          8d 17h 49m 1 Pinaki Poddar 01/Aug/09 17:05
          Resolved Resolved Closed Closed
          220d 2h 25m 1 Donald Woods 09/Mar/10 18:31

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development