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

Add accessor for PU name to EntityManagerFactory #503

Closed
gavinking opened this issue Aug 26, 2023 · 1 comment · Fixed by #504
Closed

Add accessor for PU name to EntityManagerFactory #503

gavinking opened this issue Aug 26, 2023 · 1 comment · Fixed by #504

Comments

@gavinking
Copy link
Contributor

gavinking commented Aug 26, 2023

Every persistence unit has a well-defined name in JPA.

So it would make sense to let you access it via EntityManagerFactory.getPersistenceUnitName() or even just EntityManagerFactory.getName().

This likely quite useful for generic (framework) code.

@dmatej
Copy link
Contributor

dmatej commented Aug 30, 2023

It is useful especially for some types of tests when devs spend time by investigating a "magic" when they just could use assertEquals("expectedPUName", em.getName()); to check they really work with the right entitymanager.
It could be useful also for logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants