<div dir="ltr">I think maybe we need to separate the parameters out in this case:<div><br></div><div>ejb-new-bean --beanName foo --typeName FooBar</div><div><br></div><div>We should decide what these parameters need to be called.</div>
<div><br></div><div>In addition, I&#39;m fine with the java-add-anotation command as well :) It could probably even accept full java code:</div><div><br></div><div>java-add-annotation javax.inject.Named(&quot;beanName&quot;) --target .....</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jun 15, 2014 at 4:41 PM, Antonio Goncalves <span dir="ltr">&lt;<a href="mailto:antonio.mailing@gmail.com" target="_blank">antonio.mailing@gmail.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="ltr">Here is the JIRA : <a href="https://issues.jboss.org/browse/FORGE-1880" target="_blank">https://issues.jboss.org/browse/FORGE-1880</a> (Being able to add @Named to an EJBs... or any annotation anywhere)<div>
<br></div><div>I&#39;ve linked it to <a href="https://issues.jboss.org/browse/FORGE-1838" target="_blank">https://issues.jboss.org/browse/FORGE-1838</a> (Being able to generate methods) because at the end of the day, the idea behind both JIRAs is being able to add Java artifacts (attributes, annotations, methods...) to any kind of component (entity, backing bean, rest endpoint...)</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-13 16:00 GMT+02:00 George Gastaldi <span dir="ltr">&lt;<a href="mailto:ggastald@redhat.com" target="_blank">ggastald@redhat.com</a>&gt;</span>:<div>
<div class="h5"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto"><div>+1, is there a JIRA already for this?</div><div><br>Em 13/06/2014, às 10:51, &quot;Ivan St. Ivanov&quot; &lt;<a href="mailto:ivan.st.ivanov@gmail.com" target="_blank">ivan.st.ivanov@gmail.com</a>&gt; escreveu:<br>

<br></div><div><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><blockquote type="cite"><div>
<div dir="ltr"><div>When I create an EJB with Forge with the following command : <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 : </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> annotation. Several ways to do it. On the EJB command itself, we could add a parameter : </div><div><br></div>



<div><span style="font-family:&#39;courier new&#39;,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> (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" target="_blank">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" 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></div></div><br>_______________________________________________<br>


forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org" target="_blank">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></div></div><span class="HOEnZb"><font color="#888888"><br><br clear="all">
<div><br></div>-- <br>Antonio Goncalves <br>Software architect and Java Champion<br>
<br><a href="http://www.antoniogoncalves.org/" target="_blank">Web site</a> | <a href="http://twitter.com/agoncal" target="_blank">Twitter</a> | <a href="http://www.linkedin.com/in/agoncal" target="_blank">LinkedIn</a> | <a href="http://www.parisjug.org/" target="_blank">Paris JUG</a> | <a href="http://www.devoxx.fr/" target="_blank">Devoxx France</a>
</font></span></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><br clear="all"><div><br></div>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>
&quot;Simpler is better.&quot;
</div>