glassfish
  1. glassfish
  2. GLASSFISH-165

JPQL validation: check SELECT clause requirements for ORDER BY query

    Details

    • Type: Task Task
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 9.0pe
    • Fix Version/s: not determined
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      165

      Description

      The EJBQL compiler needs to check whether the SELECT clause of an ORDER BY query
      matches the requirement as specified in section "4.9 ORDER BY Clause" of the spec:
      When the ORDER BY clause is used in an EJB QL query, each element of the SELECT
      clause of the query must be one of the following:
      1. an identification variable x, optionally denoted as OBJECT
      2. a single_valued_association_path_expression
      3. a state_field_path_expression
      In the first two cases, each orderby_item must be an orderable state-field of
      the entity abstract schema type value returned by the SELECT clause. In the
      third case, the orderby_item must evaluate to the same state-field of the same
      entity abstract schema type as the state_field_path_expression in the SELECT clause.

        Activity

        Hide
        mb124283 added a comment -

        Updated summary.

        Show
        mb124283 added a comment - Updated summary.
        Hide
        mb124283 added a comment -

        I checked in the first part of the fix: the JPQL compiler checks that an ORDER
        BY item has an orderable type.

        The Java Persistence Query Language is very restrictive about valid SELECT
        clause expressions for an ORDER BY query. Most SQL database support more. So
        checking that the type of an ORDER BY item is orerable is the most important part.
        Downgrade the task to P4.

        Show
        mb124283 added a comment - I checked in the first part of the fix: the JPQL compiler checks that an ORDER BY item has an orderable type. The Java Persistence Query Language is very restrictive about valid SELECT clause expressions for an ORDER BY query. Most SQL database support more. So checking that the type of an ORDER BY item is orerable is the most important part. Downgrade the task to P4.
        Hide
        Tom Mueller added a comment -

        Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.

        Show
        Tom Mueller added a comment - Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.

          People

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

            Dates

            • Created:
              Updated: