| Summary: | @Override annotation is causing a ValidationException when trying to generate metamodel of an entity using property access level | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Pascal Thivent <pascal> | ||||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P3 | CC: | darren, david.minsky, eclipselink.orm-inbox, guy.pelletier, karenfbutzke, kwon37xi | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Pascal Thivent
Created attachment 183262 [details]
testcase
There are some workarounds: - use FIELD access level - comment the @Override But these workaround are not really acceptable, at least for me. - I have some cases where I do not want to use field access level - having to comment @Override on my code base is... a pain. Not even mentioning the time I lost on this issue :) Thanks in advance. Try adding @Transient to the toString() method as another not great workaround. EclipseLink *should* be looking for methods annotated with JPA annotations, not just any annotation. I am upping the severity as well, this breaks metamodel generation with property access pretty badly (In reply to comment #3) > Try adding @Transient to the toString() method as another not great workaround. > EclipseLink *should* be looking for methods annotated with JPA annotations, not > just any annotation. I am upping the severity as well, this breaks metamodel > generation with property access pretty badly Thank you for the feedback. Actually, I tried using @Transient on the toString() method but it doesn't help, the annotation processor then complains with the following error. [INFO] diagnostic error: Exception [EclipseLink-7153] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.ValidationException Exception Description: Mapping annotations cannot be applied to fields or properties that have a @Transient specified. [method toString] is in violation of this restriction. ... At least, the annotation processor is consistent... Clearly, it is treating any annotation like @Override, @Deprecated, etc as a JPA annotation. And shouldn't. Created attachment 183469 [details]
Proposed changes
Changes have been submitted to the 2.2 stream. Reviewed: Tom Ware Once the 2.1.3 stream opens up, I'll submit the changes there as well. *** Bug 323672 has been marked as a duplicate of this bug. *** *** Bug 336599 has been marked as a duplicate of this bug. *** Changes were submitted to the 2.1.4 stream. Trunk checkin (2.2) r8525 2.1 branch checkin r9242 The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |