@Test(expectedExceptions = {javax.persistence.PersistenceException.class}) public void nonexistentSessionName() { JPASessionUtil.getSession("nonexistent"); fail("We shouldn't be able to acquire a Session here"); }
public static Session getSession(String persistenceUnitName) { return getEntityManager(persistenceUnitName).unwrap(Session.class); }
JPASessionUtil { public static Session getSession(String persistenceUnitName) { return getEntityManager(persistenceUnitName).unwrap(Session.class); } }
JPASessionUtil { public static Session getSession(String persistenceUnitName) { return getEntityManager(persistenceUnitName).unwrap(Session.class); }  }
JPASessionUtil { public static Session getSession(String persistenceUnitName) { return getEntityManager(persistenceUnitName).unwrap(Session.class); }  @SuppressWarnings("WeakerAccess") static synchronized EntityManager getEntityManager(String persistenceUnitName); static Session getSession(String persistenceUnitName); }
JPASessionUtil { public static Session getSession(String persistenceUnitName) { return getEntityManager(persistenceUnitName).unwrap(Session.class); }  @SuppressWarnings("WeakerAccess") static synchronized EntityManager getEntityManager(String persistenceUnitName); static Session getSession(String persistenceUnitName);  }