persistence@glassfish.java.net

RE: single access type for entire hierarchy?

From: Mike Keith <michael.keith_at_oracle.com>
Date: Wed, 15 Feb 2006 17:21:17 -0500

Is Linda not on the persistence mailing list?

Sahoo, this comment in the spec was there primarily for the
annotations case. We will try to add some language that makes
it clearer, but there is no reason why you wouldn't be able to
set different access types for different entities in XML.

The question that I expected you to ask is the part that we
have not specified in the spec yet, which is what happens
when access is set on an entity that is not metadata complete
(ie annotations may have been processed on it).

We will add a section to describe how access works,
but essentially it applies to all of the mappings defined
in XML. If metadata-complete attribute is set then that access
type will also be applied to the default mappings that get added.

-Mike

> -----Original Message-----
> From: Marina Vatkina [mailto:Marina.Vatkina_at_Sun.COM]
> Sent: Wednesday, February 15, 2006 3:41 PM
> To: persistence_at_glassfish.dev.java.net
> Cc: Michael Keith; Linda Demichiel
> Subject: Re: single access type for entire hierarchy?
>
>
> Adding Linda to the thread.
>
> -marina
>
> Sanjeeb Kumar Sahoo wrote On 02/15/06 10:22,:
> > Hi Mike,
> >
> > Michael Keith wrote:
> >
> >
> >>No, you can specify different access types in the XML mapping file.
> >>
> >>
> >
> > Thanks for responding. Now I see a small confusion for
> users here: what
> > is the access type for class Derived in the following example? Is it
> > PROPERTY because the Base class uses PROPERTY access or is it FIELD
> > because the mapping file level default is FIELD?
> >
> > (Note: the XML fragment might not comply with orm schema, it is just
> > used as example)
> > <entity-mappings>
> > <!-- mapping file level default is FIELD access-->
> > <access>FIELD</access>
> > <entity class="Base" access="PROPERTY">
> > <entity>
> > <entity class="Derived"> <!-- Derived extends Base -->
> > <entity>
> > </entity-mappings>
> >
> > Reading the spec, I don't find a clear cut answer. So my worry is do
> > have such tests in CTS to ensure portability of applications?
> >
> > Thanks,
> > Sahoo
> >
> >
> >>-----Original Message-----
> >
> >>From Sanjeeb Kumar Sahoo <Sanjeeb.Sahoo_at_Sun.COM>
> >
> >>Sent Wed 2/15/2006 5:46 AM
> >>To persistence_at_glassfish.dev.java.net
> <persistence_at_glassfish.dev.java.net>; Mike Keith
> <michael.keith_at_oracle.com>
> >>Subject single access type for entire hierarchy?
> >>
> >>Hi,
> >>
> >>[Section 2.1.1]
> >>/A single access type (field or property access) applies to
> an entity
> >>hierarchy./
> >>
> >>Is this rule applicable even when access type is specified on a per
> >>class basis using orm.xml file?
> >>
> >>Thanks,
> >>Sahoo
> >>
> >>
> >>
>
>