5.7 How to obtain the application-managed EntityManager
When the application-managed EntityManager is used, the application uses EntityManagerFactory to create EntityManager. There are two methods by which the application obtains EntityManagerFactory:
Method of using the DI to inject EntityManagerFactory in the application field and setter method
Method of using the JNDI from the application to look up EntityManagerFactory