This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 102164

Summary: Provide a method to obtain ElementHandle for the "creating" annotation
Product: javaee Reporter: Tomasz Slota <tslota>
Component: PersistenceAssignee: Andrei Badea <abadea>
Status: NEW ---    
Severity: blocker    
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Tomasz Slota 2007-04-23 15:04:05 UTC
JPA Verification often needs to access the annotation that "created" given model element, for example 
@Entity annotation in case of entity element. Such information could be easily remembered during 
creation of the model and would save some processing time for the verification module. In case the 
element was defined only in orm.xml (not using annotation) the method should return null.

Such functionality could be useful also for implementing other functionality such as refactorings.
Comment 1 Andrei Badea 2007-04-24 09:39:35 UTC
Would it be enough if you could obtain an ElementHandle<TypeElement> for the
TypeElement defining the entity class? It's not possible to return
ElementHandle's for non-elements (such as AnnotationMirror's), and I'm not
comfortable with returning "live" javac elements -- I'd prefer to return only
ElementHandle's.