问题
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.
回答1:
Please check this thread: Finding the current persistence unit for the current EntityManagerFactory
来源:https://stackoverflow.com/questions/5393167/get-the-persistence-unit-name