From open-jpa-dev-return-2225-apmail-incubator-open-jpa-dev-archive=incubator.apache.org@incubator.apache.org Fri Feb 16 01:20:27 2007 Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 70607 invoked from network); 16 Feb 2007 01:20:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Feb 2007 01:20:27 -0000 Received: (qmail 42848 invoked by uid 500); 16 Feb 2007 01:20:34 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 42822 invoked by uid 500); 16 Feb 2007 01:20:34 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 42805 invoked by uid 99); 16 Feb 2007 01:20:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Feb 2007 17:20:34 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= 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; Thu, 15 Feb 2007 17:20:25 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C14F67141E7 for ; Thu, 15 Feb 2007 17:20:05 -0800 (PST) Message-ID: <28417115.1171588805789.JavaMail.jira@brutus> Date: Thu, 15 Feb 2007 17:20:05 -0800 (PST) From: "Dain Sundstrom (JIRA)" To: open-jpa-dev@incubator.apache.org Subject: [jira] Created: (OPENJPA-152) Warn or throw an exception when a persistence unit has multiple named queries with the same name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Warn or throw an exception when a persistence unit has multiple named queries with the same name ------------------------------------------------------------------------------------------------ Key: OPENJPA-152 URL: https://issues.apache.org/jira/browse/OPENJPA-152 Project: OpenJPA Issue Type: Improvement Components: jpa Reporter: Dain Sundstrom The JPA spec makes it quite easy for uses to create multiple named queries with the same name. The problem stems from named queries being declared as part of an entity either via annotations or nested xml, but the name space for these queries is not scoped to the entity but scoped to the whole persistence unit. This problem is compounded due to the ease at which the persistence unit is easily expanded with orm.xml files and with annotated beans. I propose that we throw a deployment exception when the combined entity mapping xml files and listed classes contain multiple named queries with the same name. If after deployment, we discover another annotate bean that creates a conflict, we should log a ERROR and take extra cautions to not override the existing in place query with the newly discovered one, as this could drastically change the behavior of an application at runtime. Alternatively, we could just log warnings, but I would prefer a deployment exception as it guarantees I'm not running with a randomly selected set or queries. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.