[jboss-dev-forums] [Design of POJO Server] - MetaData hierarchy, a problem with annotations

adrian@jboss.org do-not-reply at jboss.com
Tue Oct 10 13:18:41 EDT 2006


I found a problem with using annotations in a hierarchy
(or any "collection" metadata for that matter).

Let's suppose you have an EJB annotated with
@Resources(@Resource(name="jms/Queue", type=Queue.class mappedName="queue/SomeQueue");

Then at the deployment level you've specified your datasource:
@Resources(@Resource(name="jdbc/DataSoure", type=DataSource.class mappedName="java:/DefaultDS");

Then the EJB (class level) annotation hides the deployment level annotation.

Resources resources = MetaData.getAnnotation(Resources.class);

What is really required is for this data to merged.

But obviously, it is only these collection type annotations that
should be merged to get the final result. And even then not all of them.
e.g. a hypothetical @Descriptions annotation on the deployment
and an ejb's resource ref should not be merged.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977319#3977319

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977319



More information about the jboss-dev-forums mailing list