|
|
|
Re: Can't find AccessType? [message #433544 is a reply to message #433542] |
Wed, 22 February 2006 14:51 |
Brian Vosburgh Messages: 137 Registered: July 2009 |
Senior Member |
|
|
Barry Kaplan wrote:
> Brian Vosburgh wrote:
>>
>> The AccessType annotation was removed in the Proposed Final Draft
>> (19 Dec 2005) of JSR220. The entity's access type is now implied by
>> where you put your mapping annotations: If you annotate the entity's
>> fields, the access type is FIELD; if you annotate the entity's
>> properties (i.e. the getter methods), the access type is PROPERTY.
>
> What is the default when neither is annotated? (Hibernate EJB3 seems to
> use FIELD, but is that standard?)
>
> -barry
According to the spec, one or the other will always be annotated:
at the very least you must specify a primary key field or property
(typically via the Id annotation).
Of course, when you are using Dali to annotate your Entities, there
will be times when a class is annotated as an Entity but neither fields
nor properties are yet annotated. At those times, to improve usability,
Dali will behave as though the AccessType is FIELD (e.g. the Persistence
Outline will display the Entity's fields). Likewise, when an Entity
contains annotations on *both* fields and properties, Dali will behave
as though the AccessType is FIELD and ignore any of the property
annotations.
Brian
|
|
|
|
|
Re: Can't find AccessType? [message #573327 is a reply to message #433542] |
Wed, 22 February 2006 14:51 |
Brian Vosburgh Messages: 137 Registered: July 2009 |
Senior Member |
|
|
Barry Kaplan wrote:
> Brian Vosburgh wrote:
>>
>> The AccessType annotation was removed in the Proposed Final Draft
>> (19 Dec 2005) of JSR220. The entity's access type is now implied by
>> where you put your mapping annotations: If you annotate the entity's
>> fields, the access type is FIELD; if you annotate the entity's
>> properties (i.e. the getter methods), the access type is PROPERTY.
>
> What is the default when neither is annotated? (Hibernate EJB3 seems to
> use FIELD, but is that standard?)
>
> -barry
According to the spec, one or the other will always be annotated:
at the very least you must specify a primary key field or property
(typically via the Id annotation).
Of course, when you are using Dali to annotate your Entities, there
will be times when a class is annotated as an Entity but neither fields
nor properties are yet annotated. At those times, to improve usability,
Dali will behave as though the AccessType is FIELD (e.g. the Persistence
Outline will display the Entity's fields). Likewise, when an Entity
contains annotations on *both* fields and properties, Dali will behave
as though the AccessType is FIELD and ignore any of the property
annotations.
Brian
|
|
|
Powered by
FUDForum. Page generated in 0.05442 seconds