Instead of creating a SessionFactory, use EntityManager.unwrap(Session.class) to get a Hibernate Session and retrieve the session factory from the Session object.
You can also use EntityManagerFactory.unwrap(SessionFactory.class) to get the Hibernate SessionFactory directly.