persistence@glassfish.java.net

RE: Why does this line appear in spec?

From: Mike Keith <michael.keith_at_oracle.com>
Date: Fri, 4 Aug 2006 16:22:54 -0400

Hi Sahoo,

1) It is undefined to have multiple XML entries for the same class,
so there would not be any conflicts in that context.

2) Mainly because of the hierarchy limitations that were defined for
annotations. We tried to avoid cases that rendered XML metadata more
powerful than annotations, just to keep them as equivalent as possible
thus easier to understand.

-Mike

> -----Original Message-----
> From: Sanjeeb.Sahoo_at_Sun.COM [mailto:Sanjeeb.Sahoo_at_Sun.COM]On Behalf Of
> Sanjeeb Kumar Sahoo
> Sent: Friday, August 04, 2006 11:01 AM
> To: Linda DeMichiel; Mike Keith; persistence_at_glassfish.dev.java.net
> Subject: Why does this line appear in spec?
>
>
> Hi Mike,
>
> Section #10.1.5.2 contains the following:
> /The access attribute defines the access type for the
> embeddable class.
> The access attribute overrides
> any access type specified by the persistence-unit-defaults element or
> entity-mappings
> element for the given embeddable class.
> Portable applications must not specify the access attribute if mapping
> annotations have been applied
> to the fields or properties of the embeddable class or the entity with
> which it is associated and the value
> differs from the access type defined by means of annotations.
> Portable applications must not use more than one access type within an
> entity hierarchy./
>
> I have two questions:
> 1) It requires portable applications not to specify an
> access-type that
> is different from what is defined using annotations. That
> means, a user
> can specify conflicting access-type using XML mapping file
> for an entity
> and embeddable class. Is this intentional?
>
> 2) Why does this section talk about entity hierarchy?
>
> Thanks,
> Sahoo
>