Can't find AccessType? [message #433523] |
Fri, 10 February 2006 13:37  |
Eclipse User |
|
|
|
I'm trying Dali for the first time, and I've run into a problem where
import javax.persistence.AccessType cannot be resolved. Searching
around, it appears that the class has been removed from the jboss
container. Is there a download coming that fixes this, or is there a
workaround? I also tried glassfish, but had the same problem.
Bryan
|
|
|
|
|
Re: Can't find AccessType? [message #433544 is a reply to message #433542] |
Wed, 22 February 2006 09:51  |
Eclipse User |
|
|
|
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 #572910 is a reply to message #433523] |
Fri, 10 February 2006 16:59  |
Eclipse User |
|
|
|
> I'm trying Dali for the first time, and I've run into a problem where
> import javax.persistence.AccessType cannot be resolved. Searching
> around, it appears that the class has been removed from the jboss
> container. Is there a download coming that fixes this, or is there a
> workaround? I also tried glassfish, but had the same problem.
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.
The current Dali download does not support the PFD; but that is what we
are currently working towards. See http://wiki.eclipse.org/index.php/Dali_Project
Brian
|
|
|
Re: Can't find AccessType? [message #573289 is a reply to message #433524] |
Wed, 22 February 2006 09:09  |
Eclipse User |
|
|
|
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
|
|
|
Re: Can't find AccessType? [message #573327 is a reply to message #433542] |
Wed, 22 February 2006 09:51  |
Eclipse User |
|
|
|
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.04901 seconds