<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>+1, is there a JIRA already for this?</div><div><br>Em 13/06/2014, às 10:51, "Ivan St. Ivanov" &lt;<a href="mailto:ivan.st.ivanov@gmail.com">ivan.st.ivanov@gmail.com</a>&gt; escreveu:<br><br></div><blockquote type="cite"><div><div dir="ltr">Hi folks!<div><br></div><div>I think that java-add-annotation is a good command that we should have. But still it would be better to have also something more explicit for creating named beans and setting stereotypes. So, I think that the three levels of abstraction that Antonio described may be implemented. Well, at the end they will reuse one and the same code for adding annotation, so no repeating ourselves will occur.</div>
<div><br></div><div>Cheers,</div><div>Ivan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 13, 2014 at 4:39 PM, George Gastaldi <span dir="ltr">&lt;<a href="mailto:ggastald@redhat.com" target="_blank">ggastald@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div 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" target="_blank">antonio.mailing@gmail.com</a>&gt; escreveu:<br><br></div><div><div class="h5"><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></div></div><blockquote type="cite"><div><span>_______________________________________________</span><br><span>forge-dev mailing list</span><br><span><a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a></span><br>
<span><a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a></span></div></blockquote></div><br>_______________________________________________<br>

forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br></blockquote></div><br></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>