Annotation Metadata Providing


To create API that will provide metadata defined in annotations and possibility to combine it with XML-based metadata into single model. It should be possible to use it for different areas: EJB, JPA, WS, ...

Use cases:

  1. Call EJB dialog
    1. all Session beans defined in both XML and annotations are displayed
    2. if there is no explicitly defined name attribute in @Stateless annotation, default name simple name of class) is displayed
    3. if Session bean defined in annotation is overriden in XML, name defined in XML (if it exists) is displayed
    4. each node representing Session bean in list provides also local/remote interface availability
    5. if model creation takes too long, some progress bar or icon should be displayed
    6. there should be also Session bean defined in library and in all open projects (add import if selected)
  2. JSF pages from Entity classes
    1. all Entity classes defined in both XML and annotations are displayed
    2. also Entity classes defined in libraries are visible
    3. default naming and XML overriding part is same as in UC-01 (Call EJB)
    4. each node representing Entity bean provides also information about its relationships and table name
    5. mapping information can be provided in multiple XML files
  3. WebServices logical view
    1. all WebServices defined in both XML and annotations are displayed in project logical view
    2. default naming and XML overriding part is same as in UC-01 (Call EJB)
  4. In editor add @WebService to class
    1. logical view is updated – new node representing WebService is added
  5. New annotation is added in editor (e.g. @Resource)
    1. server plugin wants to know about that and handle this situation properly
PavelBuzek: Can you add a bit more specific information about this use case? It seems like this is not an end user use case but is implied by some other use case. Which one?
  1. New annotation is added via wizard (e.g. @Resource added by Use Database action)
    1. server is asked to do its stuff by new j2eeserver API, is not interested to handle annotation change event
  2. Using JPA info in code-completion before file is saved
    1. In editor add @Entity annotation to existing class, don't save the file and use JPA=related code completion. File is not saved, but entered data is needed, it means we cannot rely only on file change listeners.
  3. Java EE Verification
    1. virtually full merged model is required.
    2. we can expect additional checks in NB 6.0
    3. NB 5.5 is using JMI only (ignoring DD) for most checks, we can see if/how much the users complain about it and possibly decide not to use DD in 6.0 as well
  4. Visual editing of metadata
    1. There can be some kind of visual or structured (nodes, property sheets, etc.) editor for JPA, EJB, WS, etc. This allows the user to edit the metadata in annotations (potentially XML, but I think annotations are a primary concern), for example DB mappings of a JPA class, through some UI.


  • enhance call to schema2beans element's method to return also model from annotation
  • schema2beans might be replaced by XAM ( in future
  • merge of XML and annotation is probably not general and must be done case-by-case
  • defaulting must be done case-by-case
  • listening on changes in file system

Comments from 1st meeting (Nov16 2006: Andrei, Erno, Marek, Martin)

  • Do we need full model, or just required parts?
  • Just required
  • Can we reuse GlassFish code? GlassFish makes also just 'snapshots' of metadata...
  •  ?
  • Don't react on document. In case we need changed data before the file is saved, there is support for that in Retouche
  • Model is read-only in NetBeans 6.0?
  • Probably yes.
  • Are there subnodes of WS element needed? (e.g. methods...)
  • Yes, WS operations are displayed as subnodes.
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo