persistence@glassfish.java.net

Doc'ing Issue #831

From: Rebecca Parks <June.Parks_at_Sun.COM>
Date: Thu, 24 Aug 2006 10:54:54 -0700

Now that the rules have been agreed upon, I'm wondering what, if
anything, needs to be doc'd, and where. Please correct me if I'm wrong,
but it seems these rules are an implementation-specific attempt to
clarify what's in the spec. Again, please correct me if I'm wrong, but
it appears the implementation is part of the App Server rather than
TopLink. So I'm guessing that a short section in the Developer's Guide
may be appropriate.

June

>
> /**
> * This method is responsible for determining the access-type for an
> * Embeddable class represented by emDescr that is passed to
> * this method. This method should *not* be called more than once
> as this is
> * quite expensive. Now the rules:
> *
> * Rule 1: In the *absence* of metadata in embeddable class,
> access-type of
> * an embeddable is determined by the access-type of the enclosing
> entity.
> *
> * Rule 2: In the presence of metadata in embeddable class,
> access-type of
> * an embeddable is determined using that metadata. This allows
> sharing
> * of the embeddable in entities with conflicting access-types.
> *
> * Rule 3: It is an error to use a *metadata-less* embeddable
> class in
> * entities with conflicting access-types as that might result in
> * different database mapping for the same embeddable class.
> *
> * Rule 4: It is an error if metadata-complete == false, and
> * metadata is present *both* in annotations and XML, and
> * access-type as determined by each of them is *not* same.
> *
> * Rule 5: It is an error if *both* fields and properties of an
> embeddable
> * class are annotated and metadata-complete == false. *