Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. package com.javaoo.store;
  2. import javax.persistence.*;
  3.  
  4. public class JPAUtility {
  5.  
  6. private static final EntityManagerFactory factory =
  7. Persistence.createEntityManagerFactory( "StorePersistance " );
  8.  
  9. private JPAUtility() {}
  10.  
  11. public static EntityManager getEntityManager() {
  12. return factory.createEntityManager();
  13. }
  14.  
  15. public static void closeEntityManagerFactory() {
  16. factory.close();
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement