Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 20540 invoked from network); 23 Sep 2009 19:25:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Sep 2009 19:25:39 -0000 Received: (qmail 80986 invoked by uid 500); 23 Sep 2009 19:25:39 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 80941 invoked by uid 500); 23 Sep 2009 19:25:38 -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 80931 invoked by uid 99); 23 Sep 2009 19:25:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Sep 2009 19:25:38 +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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Sep 2009 19:25:37 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 00948234C004 for ; Wed, 23 Sep 2009 12:25:15 -0700 (PDT) Message-ID: <593370719.1253733915987.JavaMail.jira@brutus> Date: Wed, 23 Sep 2009 12:25:15 -0700 (PDT) From: "Donald Woods (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-1116) Annotation Strategy not working In-Reply-To: <774032385.1244036407681.JavaMail.jira@brutus> 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/OPENJPA-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Donald Woods updated OPENJPA-1116: ---------------------------------- Affects Version/s: 1.3.0 Fix Version/s: 2.0.0-M3 1.3.0 Assignee: Pinaki Poddar > Annotation Strategy not working > ------------------------------- > > Key: OPENJPA-1116 > URL: https://issues.apache.org/jira/browse/OPENJPA-1116 > Project: OpenJPA > Issue Type: Bug > Components: jdbc > Affects Versions: 1.3.0, 2.0.0-M2 > Environment: Windows XP, openjpa-2.0.0 source code > Reporter: Ashish Paliwal > Assignee: Pinaki Poddar > Fix For: 1.3.0, 2.0.0-M3 > > Attachments: OPENJPA-1116-2.0.0(2).patch, OPENJPA-1116-2.0.0.patch, testStrategyAnnotation.jar > > > I had 2 entities, Person and Address where person had id, age, name and address_id and person had id and city. > I tried to apply the Strategy on Address so that upon execution of JPQL query "Select p from Person p" the SQL query fired should make Inner Join rather than the default Left Outer Join. > I created a Strategy class InnerJoinStrategy that makes sure this happens by overriding the selectEagerJoin() method and gave @Strategy(value = "somepackage.InnerJoinStrategy" ) in Person class before getAddress() method. > But unexpectedly, it was still making the LeftOuterJoin rather than the desired InnerJoin. Upon debugging I found that my strategy was never being called. I debugged further and found that in AnnotationPersistenceMappingParser class in parseMemberMappingAnnotations() method, for the case STRAT( which belongs to the Strategy annotation) the strategy value was being set in ValueMappingInfo, while from RuntimeStrategyInstaller it was being fetched from FieldMappingInfo. I changed the code to set it in FieldMappingInfo and everything worked fine. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.