Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: AW: [dali-dev] Default entity's data access

I'm going to answer my own question: the use case I gave should be an error in the Generic platform. The spec says the location of annotations defines the default access, but says nothing like that about defaulting based on the access type of a particular orm.xml attribute mapping being set.

Adrian, I agree with you in principal that there is no default access for generic. But in order to give a helpful UI in this case we have chosen to keep the default as FIELD so that the user sees implied mappings in the JPA structure view even when they have not yet defined the access type. Bug 317848 will cover adding an error for the generic platform and quick fixes to add the access type to the entity, entity-mappings, or persistence-unit-defaults. Any takers on contributing this or other quick fixes?

Thanks,
Karen

On 6/25/2010 10:11 AM, Karen Butzke wrote:
We currently ask for but do not require an access type when the user creates an orm.xml file via the New Mapping File wizard.  We also have a Generic platform default of FIELD in the Java case when nothing has yet been specified. We do this so that something appears in our structure view, otherwise the user would not see any mappings in the structure view and would be forced to enter an annotation via the source.

Does anyone know if the following defines a default access of FIELD for the Foo entity in the generic platform case? No annotations exist on the Java class.

    <entity class="model.Foo" access= field>
      
    </entity>

Karen

On 6/25/2010 9:41 AM, Goerler, Adrian wrote:

Hi,

 

I think Dali should not implicitly assume a default access type in this case. The generic platform should behave neutrally. I think it could indicate an undeterminable access type as an error and could for example offer quick fixes to add either access type explicitly to the XML. Alternatively, it could ask for the desired access type upon creation of an orm.xml.

 

-Adrian

 

 

 

Adrian Görler
SAP AG

Pflichtangaben/Mandatory Disclosure Statements: http://www.sap.com/company/legal/impressum.epx

 

Von: dali-dev-bounces@xxxxxxxxxxx [mailto:dali-dev-bounces@xxxxxxxxxxx] Im Auftrag von Dmitry Geraskov
Gesendet
: Freitag, 25. Juni 2010 15:30
An: Karen Butzke
Cc: General Dali EJB ORM developer discussion.
Betreff: Re: [dali-dev] Default entity's data access

 

Thank you Karen for supporting my minds.
I am not sure that bug 317848 is required, because Hibernate also has default access type (property).
I set default access type for hibernate platform to "property".

Dmitry Geraskov.

24/06/2010 18:45, Karen Butzke wrote:

Dmitry,

>From the spec section 2.3.1:
    It is an error if a default access type cannot be determined and an access type is not explicitly specified
    by means of annotations or the XML descriptor.

We chose to have a default access where there are no annotations in java and an access type is not set in the XML so that the user would be able to see and map attributes in the JPA Structure view. EclipseLink as the reference implementation uses FIELD as the default so we picked FIELD. I think we should have an error or a warning in this case on the Generic platform since the spec says it is an error.. The EclipseLink platform would not have an error. The Hibernate platform could make the default PROPERTY and not have an error. I have entered bug 317848

Thanks,
Karen


On 6/24/2010 5:14 AM, Dmitry Geraskov wrote:

Hi, guys,

I noticed that default data access for entity's data is "field" when I make orm.xml mapping.
At least JPA Details view says me this(see attachment). Is it mentioned somewhere in jpa specification or somewhere else?
I ask because Hibernate implementation uses "property" as default entity's data access.

Thanks,
Dmitry Geraskov.


 
_______________________________________________
dali-dev mailing list
dali-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dali-dev
  
 
 
_______________________________________________
dali-dev mailing list
dali-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dali-dev
  
_______________________________________________ dali-dev mailing list dali-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/dali-dev

Back to the top