Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7DB2E757A for ; Wed, 20 Jul 2011 19:47:23 +0000 (UTC) Received: (qmail 43213 invoked by uid 500); 20 Jul 2011 19:47:23 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 42979 invoked by uid 500); 20 Jul 2011 19:47:22 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 42966 invoked by uid 99); 20 Jul 2011 19:47:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jul 2011 19:47:21 +0000 X-ASF-Spam-Status: No, hits=-2001.1 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jul 2011 19:47:19 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C2B784B9F6 for ; Wed, 20 Jul 2011 19:46:57 +0000 (UTC) Date: Wed, 20 Jul 2011 19:46:57 +0000 (UTC) From: "Milosz Tylenda (JIRA)" To: dev@openjpa.apache.org Message-ID: <1705055717.8931.1311191217779.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (OPENJPA-487) Generated SUBSTRING SQL is ugly and inefficient MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Milosz Tylenda resolved OPENJPA-487. ------------------------------------ Resolution: Fixed > Generated SUBSTRING SQL is ugly and inefficient > ----------------------------------------------- > > Key: OPENJPA-487 > URL: https://issues.apache.org/jira/browse/OPENJPA-487 > Project: OpenJPA > Issue Type: Improvement > Components: sql > Affects Versions: 0.9.0, 0.9.6, 0.9.7, 1.0.0, 1.0.1, 1.0.2, 1.1.0 > Reporter: Patrick Linskey > Assignee: Milosz Tylenda > Priority: Minor > Fix For: 2.2.0 > > Attachments: handle_params_in_group_by.patch > > > 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. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira