Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 92253 invoked from network); 5 May 2007 11:44:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 May 2007 11:44:36 -0000 Received: (qmail 15240 invoked by uid 500); 5 May 2007 11:44:43 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 15123 invoked by uid 500); 5 May 2007 11:44:42 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 15112 invoked by uid 99); 5 May 2007 11:44:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 May 2007 04:44:42 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 May 2007 04:44:35 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A308771406A for ; Sat, 5 May 2007 04:44:15 -0700 (PDT) Message-ID: <6924347.1178365455664.JavaMail.jira@brutus> Date: Sat, 5 May 2007 04:44:15 -0700 (PDT) From: "Thomas Fischer (JIRA)" To: torque-dev@db.apache.org Subject: [jira] Closed: (TORQUE-93) Joins in Criteria used to delete data can delete datasets also in joined table In-Reply-To: <23659562.1178365156588.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/TORQUE-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thomas Fischer closed TORQUE-93. -------------------------------- Resolution: Fixed Fix Version/s: 3.3-RC3 > Joins in Criteria used to delete data can delete datasets also in joined table > ------------------------------------------------------------------------------ > > Key: TORQUE-93 > URL: https://issues.apache.org/jira/browse/TORQUE-93 > Project: Torque > Issue Type: Bug > Components: Runtime > Reporter: Thomas Fischer > Assigned To: Thomas Fischer > Priority: Critical > Fix For: 3.3-RC3 > > > Code to reproduce the error: > criteria.add(BookPeer.AUTHOR_ID, authorId); > criteria.addJoin(AuthorPeer.AUTHOR_ID, BookPeer.AUTHOR_ID); > // the following is not needed from a SQL point of view but to generate the unexpected behaviour > criteria.add(AuthorPeer.AUTHOR_ID, authorId); > BookPeer.doDelete(criteria); > Additionally to deleting the chosen books, this will also delete the corresponding authors. What happens is that the criteria gets passed to BasePeer, which tries to figure the table to delete from from the criteria alone. But as it contains two tables in the where clause, it does not know which one is the right table, and deletes the data from both tables. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org