Harold -

I'm quite surprised that we don't throw an exception, or warning in this
case also. In the case that you mentioned, I assume MyInterface isn't an
Entity type and doesn't extend Serializable?

Thanks,
Rick

On Fri, Nov 25, 2011 at 6:00 AM, Harald Wellmann <
hwellmann...@googlemail.com> wrote:

> In a code review of an application using OpenJPA 2.1.1 with
> persistence mapping by annotations, I've just come across an entity
> class with a non-primitive field which is not annotated:
>
>   private MyInterface myInterface;
>
> I would have put a @Transient annotation on that field (or better
> still, removed it from the model), but what surprises me is that
> OpenJPA silently treats this field as transient and does not complain
> about a missing @Transient annotation.
>
> We use build time enhancement, and I can see no warnings from OpenJPA
> either at build time or at run-time.
>
> According to the JPA 2.0 spec, section 2.3.1, "all non-transient
> instance variables that are not annotated with the Transient
> annotation are persistent.", so I'd really expect OpenJPA to complain
> that MyInterface is not mapped.
>
> What do you think?
>
> Best regards,
> Harald
>



-- 
*Rick Curtis*

Reply via email to