code_junkie

JPA default persistence unit

Nov 13th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. @Before
  2. public void createEntityManagerFactory() throws IOException {
  3. final Properties p = new Properties();
  4. p.load(getClass().getResourceAsStream("/inmemory.properties"));
  5. emf = Persistence.createEntityManagerFactory("default", p);
  6. }
  7.  
  8. /**
  9. * Injected persistence context.
  10. */
  11. @PersistenceContext
  12. private EntityManager em;
Add Comment
Please, Sign In to add comment