<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I am leaning towards the java-add-annotation approach as it seems more intuitive and could solve other use cases that may arise.</div><div><br>Em 13/06/2014, às 04:19, Antonio Goncalves &lt;<a href="mailto:antonio.mailing@gmail.com">antonio.mailing@gmail.com</a>&gt; escreveu:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div>When I create an EJB with Forge with the following command :&nbsp;<br></div><div><br></div><div><font face="courier new, monospace">ejb-new-bean --named MyService<br></font></div><div><br></div><div>I get the following :&nbsp;</div>
<div><br></div><div><font face="courier new, monospace">@Stateless<br></font></div><div><font face="courier new, monospace">@LocalBean</font></div><div><font face="courier new, monospace">public class MyService implements Serializable</font></div>
<div><br></div><div>In some cases, I would need to add an extra <font face="courier new, monospace">@Named</font>&nbsp;annotation. Several ways to do it. On the EJB command itself, we could add a parameter :&nbsp;</div><div><br></div>
<div><span style="font-family:'courier new',monospace">ejb-new-bean --named MyService --addNamed</span><br></div><div><br></div><div>But I think it would be good to have something more generic that could be used anywhere. We could use the same logic as <font face="courier new, monospace">constraint-add</font>&nbsp;(that adds any kind of constraint on any Entity) and have something like</div>
<div><br></div><div><font face="courier new, monospace">cdi-add-qualifier --qualifier Named --target org.app.service.MyService<br></font></div><div><font face="courier new, monospace">// or on a property, which could be useful</font></div>
<div><div><font face="courier new, monospace">cdi-add-qualifier --qualifier Named --onProperty myProp</font></div></div><div><div><font face="courier new, monospace">cdi-add-qualifier --qualifier Named --onMethod myMethod</font></div>
</div><div><font face="courier new, monospace"><br></font></div><div>Or something even more generic would be to use the Java command</div><div><br></div><div><font face="courier new, monospace">java-add-annotation --annotation javax.inject.Named --target org.app.service.MyService<br>
</font></div><div><font face="courier new, monospace">java-add-annotation --annotation javax.inject.Named --target org.app.service.MyService --onProperty myProp</font></div><div><font face="courier new, monospace">java-add-annotation --annotation javax.inject.Named --target org.app.service.MyService --onMethod myMethod</font></div>
<div><font face="courier new, monospace">java-add-annotation --annotation javax.inject.Named --onProperty myProp</font></div><div><font face="courier new, monospace">java-add-annotation --annotation javax.inject.Named --onMethod myMethod</font></div>
<div><br></div><div>Any thoughts ?</div><div><br></div><div>Antonio</div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>forge-dev mailing list</span><br><span><a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/forge-dev">https://lists.jboss.org/mailman/listinfo/forge-dev</a></span></div></blockquote></body></html>