From dev-return-9153-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 10 22:47:37 2008 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 23881 invoked from network); 10 Sep 2008 22:47:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Sep 2008 22:47:37 -0000 Received: (qmail 65416 invoked by uid 500); 10 Sep 2008 22:47:34 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 65386 invoked by uid 500); 10 Sep 2008 22:47:34 -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 65355 invoked by uid 99); 10 Sep 2008 22:47:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 15:47:34 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 22:46:44 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2F0B9234C1DB for ; Wed, 10 Sep 2008 15:46:46 -0700 (PDT) Message-ID: <436044518.1221086806191.JavaMail.jira@brutus> Date: Wed, 10 Sep 2008 15:46:46 -0700 (PDT) From: "Catalina Wei (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Created: (OPENJPA-720) The pushdown sql for version columns in primary and secondary tables has unpredictable ordering in the select and from clause MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org The pushdown sql for version columns in primary and secondary tables has unpredictable ordering in the select and from clause ----------------------------------------------------------------------------------------------------------------------------- Key: OPENJPA-720 URL: https://issues.apache.org/jira/browse/OPENJPA-720 Project: OpenJPA Issue Type: Improvement Affects Versions: 1.2.0, 1.1.0, 1.0.3, 1.0.2, 1.0.1, 1.0.0, 0.9.7, 0.9.6, 0.9.0, 1.0.4 Reporter: Catalina Wei We observe that two differenct pushdown sql could be generated for entities with multi-table mapping and version columns in each table. Here is an example, where entity is having 1 primary table, 2 secondary tables, and each table has a version column, an em.find() could result in following sqls: SELECT t0.version, t1.version, t2.version, t1.col1, t0.col2, t2.col3 FROM TS2 t0 INNER JOIN TS1 t1 ON t0.ID = t1.id INNER JOIN TS3 t2 ON t1.id = t2.ID WHERE t1.id = ? optimize for 1 row SELECT t0.version, t1.version, t2.version, t2.col1, t1.col2, t0.col3 FROM TS3 t0 INNER JOIN TS1 t2 ON t0.ID = t2.id INNER JOIN TS2 t1 ON t2.id = t1.ID WHERE t2.id = ? optimize for 1 row If the HashMap is changed to LinkedHashMap, then the pushdown sql will have predictable ordering in select and from clause. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.