use of com.company.app.model.Person in project microservices by pwillhan.
the class App method entityManager.
private static void entityManager() {
final EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("test");
final EntityManager entityManager = entityManagerFactory.createEntityManager();
final Person person = new Person();
person.setName("Dick");
entityManager.getTransaction().begin();
entityManager.persist(person);
entityManager.getTransaction().commit();
entityManager.close();
entityManagerFactory.close();
}
Aggregations