Return-Path: Delivered-To: apmail-cayenne-commits-archive@www.apache.org Received: (qmail 82967 invoked from network); 24 Sep 2010 22:57:00 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 24 Sep 2010 22:57:00 -0000 Received: (qmail 19287 invoked by uid 500); 24 Sep 2010 22:57:00 -0000 Delivered-To: apmail-cayenne-commits-archive@cayenne.apache.org Received: (qmail 19256 invoked by uid 500); 24 Sep 2010 22:57:00 -0000 Mailing-List: contact commits-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list commits@cayenne.apache.org Received: (qmail 19249 invoked by uid 99); 24 Sep 2010 22:56:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Sep 2010 22:56:59 +0000 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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Sep 2010 22:56:57 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8OMuZHo003723 for ; Fri, 24 Sep 2010 22:56:35 GMT Message-ID: <25611169.393841285368995719.JavaMail.jira@thor> Date: Fri, 24 Sep 2010 18:56:35 -0400 (EDT) From: "Misha Doronin (JIRA)" To: commits@cayenne.apache.org Subject: [jira] Issue Comment Edited: (CAY-1484) Flattened attribute queries are incorrectly generated In-Reply-To: <12847288.384881285337674468.JavaMail.jira@thor> 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/CAY-1484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12914666#action_12914666 ] Misha Doronin edited comment on CAY-1484 at 9/24/10 6:55 PM: ------------------------------------------------------------- As you requested, here it goes. Two configurations, one worknig, one not. And in "bug" configuration, there is commented out line in Main.java, which if enabled, causes null pointer exception. was (Author: misdoro): As you requested, here it goes. In fact it depends on the order you generate classes in modeler, and in the order dependencies are placed in BugDemoMap.map.xml See diff -u bugdemo/src/main/resources/BugDemoMap.map.xml bugdemo_nobug/src/main/resources/BugDemoMap.map.xml And in "bug" configuration, there is commented out line in Main.java, which if enabled, causes null pointer exception. > Flattened attribute queries are incorrectly generated > ----------------------------------------------------- > > Key: CAY-1484 > URL: https://issues.apache.org/jira/browse/CAY-1484 > Project: Cayenne > Issue Type: Bug > Components: Core Library > Affects Versions: 3.0.1 > Environment: Gentoo linux > MySQL 5.1 > java version "1.6.0_20" > Java(TM) SE Runtime Environment (build 1.6.0_20-b02) > Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode) > Reporter: Misha Doronin > Attachments: bugdemo_maven_derby.zip, bugdemo_maven_derby_nobug.zip, CayenneBugDemo.zip > > Original Estimate: 1h > Remaining Estimate: 1h > > Attached eclipse project demonstrating issue, including cayenne model > When creating database structure like: > table1 > t1key > t1value > t2keyref > table2 > t2key > t2value > t3keyref > table3 > t3key > t3value > and cayenne model with flattened attribute table3.t3value in table2 > it produces incorrect join query to table2 and 3: > SELECT t1.t3value, t1.t2key, t0.t2value, t0.t3keyref, t0.t2key FROM testschema.table2 t0 JOIN testschema.table3 t1 ON (t0.t3key = t1.t3keyref) WHERE t0.t2key = ? > Note t1.t2key, which obviously shouldn't be there and produces error. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.