quarkus: Generate the missing no-args constructor for normal scoped CDI beans

This should work

@ApplicationScoped
public class MyBean {
    private EntityManager em;

    @Inject
    public MyBean( EntityManager em) {
        this.em = em;
    }

    public EntityManager em() {
        return em;
    }
}

but I have to add the default constructor

@ApplicationScoped
public class MyBean {
    private EntityManager em;

    MyBean() {

    }

    @Inject
    public MyBean( EntityManager em) {
        this.em = em;
    }

    public EntityManager em() {
        return em;
    }
}

Can we simply add it @mkouba

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Ah, I was missing the question mark 😉. Anyway, it is probably a better design but as usual - more generic design is harder to implement. So I would propose to create a new issue to address this problem. @geoand WDYT?

@geoand I’m working on it and even have a working prototype but I didn’t know we have something for RESTEasy. Could you point me to the relevant sources?