Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve EntityManager injection #3

Open
ivannov opened this issue Dec 20, 2017 · 0 comments
Open

Improve EntityManager injection #3

ivannov opened this issue Dec 20, 2017 · 0 comments
Assignees

Comments

@ivannov
Copy link
Contributor

ivannov commented Dec 20, 2017

So far EntityManager producer relies that there is just one persistence unit defined in persistence.xml. However, this is not always the case. It should be possible to configure that this way:

@Inject
@PersistenceUnitName("myUnit")
private EntityManager em;

Another thing to be taken into account is the way to initialize the EntityManagerFactory. Consider this blog post: https://vladmihalcea.com/2017/12/19/how-to-bootstrap-jpa-programmatically-without-the-persistence-xml-configuration-file/

@ivannov ivannov self-assigned this Jan 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant