users@jpa-spec.java.net

[jpa-spec users] Re: finality: prohibited for ALL methods of all kinds in entity classes?

From: Laird Nelson <ljnelson_at_gmail.com>
Date: Sun, 22 Dec 2013 11:08:55 -0800

On Wed, Dec 18, 2013 at 3:01 PM, Laird Nelson <ljnelson_at_gmail.com> wrote:

> On Tue, Dec 17, 2013 at 6:11 AM, Kevin Sutter <sutter_at_us.ibm.com> wrote:
>
>> I don't know all of this history with this, but my guess is that this
>> "final" restriction is due to the JPA Providers that monitor persistence
>> activities by creating subclasses of the Entity classes. It's not due to
>> the bytecode injection since that should still be doable even if the
>> classes or methods are marked "final".
>
>
> Right, duh; of course. Thanks; that explains it.
>

Actually, that doesn't explain it. Unless I'm missing something, a static
method's being final wouldn't prevent subclassing. I think I understand
that from the specification's point of view a non-persistence-related
instance method can't be final either because of course the JPA provider
has no way of knowing what instance methods might affect the entity's
persistent state, so it needs to be able to override all of them in a
subclass (not just some of them). But statics? Surely not. Or private
instance methods?

I freely recognize I may be way too nit-picky here, but the fact that the
specification says no--nada, none--methods may be final makes me suspicious
that I'm still missing something.

Best,
Laird

-- 
http://about.me/lairdnelson