]
Antonio Goncalves updated FORGE-2079:
-------------------------------------
Summary: Being able to add a new CDI producer field (was: Being able to create a new
CDI producer field)
Being able to add a new CDI producer field
------------------------------------------
Key: FORGE-2079
URL:
https://issues.jboss.org/browse/FORGE-2079
Project: Forge
Issue Type: Sub-task
Components: Java EE
Affects Versions: 2.12.1.Final
Reporter: Antonio Goncalves
Fix For: 2.x Future
It would be good to have a command to add a CDI producer field to an existing class. A
simple command such as :
{code}
cdi-add-producer-field --named em --type javax.persistence.EntityManager
{code}
Would generate :
{code}
public class DatabaseProducer
{
@Produces
private EntityManager em;
}
{code}
Then, we can have more attributes :
{code}
cdi-add-producer-field --named em --type javax.persistence.EntityManager --qualifier
Production --alternative=true --scoped Request --atNamed=true
{code}
{code}
public class DatabaseProducer
{
@Produces
@Production
@Alternative
@RequestScoped
@Named
private EntityManager em;
}
{code}