From dev-return-21235-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Thu Nov 8 17:12:19 2012 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 E0869D275 for ; Thu, 8 Nov 2012 17:12:19 +0000 (UTC) Received: (qmail 89331 invoked by uid 500); 8 Nov 2012 17:12:19 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 89064 invoked by uid 500); 8 Nov 2012 17:12:19 -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 88651 invoked by uid 99); 8 Nov 2012 17:12:14 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 17:12:14 +0000 Date: Thu, 8 Nov 2012 17:12:14 +0000 (UTC) From: "Helen Xu (JIRA)" To: dev@openjpa.apache.org Message-ID: <1991654183.87386.1352394734281.JavaMail.jiratomcat@arcas> In-Reply-To: <1110391941.87380.1352394733358.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (OPENJPA-2295) speed up query metadata lookup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-2295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Helen Xu updated OPENJPA-2295: ------------------------------ Issue Type: New Feature (was: Bug) > speed up query metadata lookup > ------------------------------ > > Key: OPENJPA-2295 > URL: https://issues.apache.org/jira/browse/OPENJPA-2295 > Project: OpenJPA > Issue Type: New Feature > Components: performance, query > Reporter: Helen Xu > Assignee: Helen Xu > Priority: Minor > > I noticed that it used the queryKey as the map key for metadataRepository._queries, but when it goes to look up, it always uses query name. > I double checked the JPA Spec and OPENJPA menu, it seems only support the named query creation using query name, which means the query name should be unique in one EntityManager. It doesn't matter in which entity the query is defined. So using name as the map look up key should be good enough. > when there are two queries with the same name defined in the different entities, it will only keep the query metadata for the first loaded named query and ignore the rest plus log a warning message like this: > WARN [main] openjpa.MetaData - Ignoring duplicate query "X" in "class org.apache.openjpa.A". A query with the same name been already declared in "class org.apache.openjpa.B". -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira