hibernate entitymanager save object code example
Example: Create EntityManager Hibernate
EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("Books");
EntityManager entityManager = entityManagerFactory.createEntityManager();