== SessionFactory vs EntityManagerFactory
SessionFactory: Hibernate interface
EntityManagerFactory: JPA standard interface
Best practice is to use JPA, the EntityManager. In case you missed features provided by Session, you can always get Session from the following statement:
Session session = entityManager.unwrap(Session.class);