openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Curtis (JIRA)" <>
Subject [jira] [Commented] (OPENJPA-1977) Final methods are not supported but documentation sais they are
Date Tue, 12 Apr 2011 14:59:05 GMT


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.


[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:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.1.0
>            Reporter: Heinz Striebeck
>            Assignee: Rick Curtis
>            Priority: Minor
> See
> 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:
> So at least the documentation should be changed.
> An error message at runtime would also be fine - that would be also related to

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message