I have a class that looks like this:
@Named
public class TableView {
@PersistenceContext protected EntityManager em;
@Resource protected UserTransaction utx;
And of course I can get an instance during the construction of my bean like this:
@Inject private TableView view;
I believe it is CDI that has the job of filling in the EntityManager and the UserTransaction. However, after my user class has been instantiated I sometimes want another instance of TableView so how do I get it? Obviously
TableView anotherView = new TableView();
won't work since em and utx will be null. So how do I get a new working instance with the injections performed?