Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 30293 invoked from network); 21 May 2009 00:47:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 May 2009 00:47:13 -0000 Received: (qmail 70799 invoked by uid 500); 21 May 2009 00:47:26 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 70729 invoked by uid 500); 21 May 2009 00:47:26 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 70719 invoked by uid 99); 21 May 2009 00:47:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 May 2009 00:47:26 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fyrewyld@gmail.com designates 74.125.78.25 as permitted sender) Received: from [74.125.78.25] (HELO ey-out-2122.google.com) (74.125.78.25) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 May 2009 00:47:15 +0000 Received: by ey-out-2122.google.com with SMTP id 22so179069eye.57 for ; Wed, 20 May 2009 17:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=YVRdtwdWhiR1U7ckYxemy+wHUZ95sRjmUKZ05QR2DH0=; b=SOGr7avDynC79Kp04laiZKQ/v9fZhjeXdob7tX6CAMWFurF8/qVo8sWylqikBQ/iEy ImioeygUuhdcFxk5iyMrE5OfOnn2M2wepMDyJiBzlBJazdY23Ga0nXHbDGfutmNGvY8b RHgw+ClCOrY6kLObbospEcd7WyzreC55/1Mfg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=v9ZpBVOSyeRTeRgFB8ntsRkHtQnEnoZgY9LKdAZeHqZEBGZXpuwIqRVYwOgmllrHl7 r9FvcmgwtItEcOSfTJbq7Fhz67oxbT46GDsXCWYUslQ5Uq066QhZCOWng8J2ErrdiB+d OMKn97Hmsr8FLnqcaBUPTmkyzRlu9Rpjj4+PY= MIME-Version: 1.0 Received: by 10.216.70.130 with SMTP id p2mr423917wed.190.1242866813320; Wed, 20 May 2009 17:46:53 -0700 (PDT) In-Reply-To: <4A149017.10803@gmail.com> References: <1241706607858-2828426.post@n2.nabble.com> <1241789292371-2845300.post@n2.nabble.com> <1242050705370-2863129.post@n2.nabble.com> <1242051025634-2863155.post@n2.nabble.com> <4A08687E.20003@gmail.com> <74E82682-7089-4513-8909-33A5E7C9EEA1@SUN.com> <4A149017.10803@gmail.com> Date: Wed, 20 May 2009 19:46:53 -0500 Message-ID: <3474d1110905201746o4d39dff3s119027f39df7e607@mail.gmail.com> Subject: Re: TABLE_PER_CLASS does not work as described in JSR-220 (JPA-1.0) From: Jody Grassel To: users@openjpa.apache.org Content-Type: multipart/alternative; boundary=00504502d175e93e9f046a617a47 X-Virus-Checked: Checked by ClamAV on apache.org --00504502d175e93e9f046a617a47 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Looking at your data model, you're intending the class AbstractFoo to define new persistent types without AbstractFoo having a table mapping. Instead of annotating the abstract class with the @Entity annotation, I think you should use the @MappedSuperclass annotation. What I think should be determined is if an abstract class annotated with @Entity should "reset" the inheritance hierarchy (as the only reason for the existence of such a definition would be to provide an inheritance base, abstract types can't have their own instance, so they must be extended by another class.) or throw an error during enhancement/runtime. On Wed, May 20, 2009 at 6:19 PM, Serge Bogatyrev wrote: > I've created an issue: OPENJPA-1096 < > https://issues.apache.org/jira/browse/OPENJPA-1096> > > > Craig L Russell wrote: > >> Hi Serge, >> >> Could you please open a JIRA so we can track this issue? >> >> Thanks, >> >> Craig >> >> On May 11, 2009, at 11:03 AM, Serge Bogatyrev wrote: >> >> This mixed strategy can be very usefull. But obviously there is >>> uncompatibility with standards. I think that additional annotation can be >>> used to change standard behaviour. So, at this example strict >>> TABLE_PER_CLASS strategy should work without any additional annotations. And >>> to get the mixed strategy we shoud add @Inheritance annotation to some class >>> in hierarchy (e.g. AbsractFoo). >>> >>> Pinaki Poddar: >>> >>>> You are right. OpenJPA should use the inheritance strategy used at the >>>> root >>>> of the hierarchy throughout the derived tree. The extra strategy >>>> specification perhaps is resulting from the facility to support mixed >>>> strategy. Needs further investigation... >>>> >>>> >>>> hallmit wrote: >>>> >>>> Thanks guys, I put >>>>> @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) >>>>> to AbstractFoo and now it works fine...I have also put >>>>> @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) to the first >>>>> concrete class of my class hierarchy otherwise the SINGLE_TABLE >>>>> strategy >>>>> is used for the branch. I thought it was sufficient to annotate the >>>>> root class with >>>>> TABLE_PER_CLASS and so all classes in the hierarchy would have the same >>>>> strategy...apparently not for OpenJPA... >>>>> >>>>> JSR 220 (JPA-1.0) spec talk : >>>>> >>>>> "The Inheritance annotation defines the inheritance strategy to be used >>>>> for an entity class hierarchy. >>>>> It is specified on the entity class that is the root of the entity >>>>> class >>>>> hierarchy." >>>>> ... >>>>> In any case thank you very much for your help! >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> ----- >>>> Pinaki Poddar http://ppoddar.blogspot.com/ >>>> >>>> http://www.linkedin.com/in/pinakipoddar >>>> OpenJPA PMC Member/Committer >>>> JPA Expert Group Member >>>> >>>> >>> >> Craig L Russell >> Architect, Sun Java Enterprise System http://db.apache.org/jdo >> 408 276-5638 mailto:Craig.Russell@sun.com >> P.S. A good JDO? O, Gasp! >> >> > --00504502d175e93e9f046a617a47--