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

Generated SUBSTRING SQL is ugly and inefficient

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.9.0, 0.9.6, 0.9.7, 1.0.0, 1.0.1, 1.0.2, 1.1.0
    • 2.2.0
    • sql
    • None

    Description

      When performing a JPQL query with a SUBSTRING clause, OpenJPA converts from one-based index + length parameters to zero-based index + end index for internal handling, and then re-converts back to one-based + length when generating SQL. This conversion is entirely performed in query values, so the generated SQL has a lot of math in it. This extra math is never necessary.

      Attachments

        1. handle_params_in_group_by.patch
          1 kB
          Milosz Tylenda

        Issue Links

          Activity

            People

              milosz Milosz Tylenda
              pcl Patrick Linskey
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: