Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 70545 invoked from network); 12 Apr 2011 14:59:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Apr 2011 14:59:44 -0000 Received: (qmail 75397 invoked by uid 500); 12 Apr 2011 14:59:43 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 75364 invoked by uid 500); 12 Apr 2011 14:59:43 -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 75356 invoked by uid 99); 12 Apr 2011 14:59:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2011 14:59:43 +0000 X-ASF-Spam-Status: No, hits=-1998.7 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD,URI_HEX X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2011 14:59:42 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id A9F899EE7F for ; Tue, 12 Apr 2011 14:59:05 +0000 (UTC) Date: Tue, 12 Apr 2011 14:59:05 +0000 (UTC) From: "Rick Curtis (JIRA)" To: dev@openjpa.apache.org Message-ID: <2055666904.52373.1302620345677.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1143093590.50483.1302555965708.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (OPENJPA-1977) Final methods are not supported but documentation sais they are 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-1977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018852#comment-13018852 ] Rick Curtis commented on OPENJPA-1977: -------------------------------------- I've been doing some research this morning and it seems that our docs, code, and the spec are a bit in contradiction. In the cases I tested, the code seems to ignore any annotations on methods that are marked as final. The spec states "The entity class must not be final. No methods or persistent instance variables of the entity class may be final". Our docs[1] state that if an annotation isn't present, a final field will be treated as transient. I can certainly see the case where I'd want to mark methods on a super class final so that subclasses can't override certain methods. Unfortunately that design goes against the spec (I presume due to subclassing JPA providers) and we don't currently support the behavior. I could be swayed, but I'm thinking that I'm going to update the docs to accurately reflect what the code really does and add a new warning message for when we detect this condition. Thoughts? [1] 2.15. Persistent Field Defaults In the absence of any of the annotations above, JPA defines the following default behavior for declared fields: 1. Fields declared static, transient, or final default to non-persistent. > Final methods are not supported but documentation sais they are > --------------------------------------------------------------- > > Key: OPENJPA-1977 > URL: https://issues.apache.org/jira/browse/OPENJPA-1977 > Project: OpenJPA > Issue Type: Bug > Components: jpa > Affects Versions: 2.1.0 > Reporter: Heinz Striebeck > Assignee: Rick Curtis > Priority: Minor > > See http://openjpa.208410.n2.nabble.com/Issues-with-GeneratedValue-and-SequenceGenerator-td6244055.html > When using final methods for the id field, the generated id is unavailable for the application. > According to the mailing list, final methods are not supported, but the OpenJPA documentation sais so: > http://openjpa.apache.org/builds/2.1.0/apache-openjpa-2.1.0/docs/manual/jpa_overview_pc.html#jpa_overview_pc_final > So at least the documentation should be changed. > An error message at runtime would also be fine - that would be also related to > https://issues.apache.org/jira/browse/OPENJPA-465 -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira