This question is an exact duplicate of:
- Finding the current persistence unit for the current EntityManagerFactory 2 answers
How do you get the name of a persistence-unit in Java? I have a persistence.xml with many units, so I want to control which unit is used to create my EntityManager.
There's method like getPersistenceName
or smth
? I have searched for a while but did not find anything useful.