use of ua.logos.orm2.entity.Category in project Logos_Materials_October_2017 by VolodymyrZavada.
the class App method main.
public static void main(String[] args) {
EntityManagerFactory factory = Persistence.createEntityManagerFactory("mysql");
EntityManager em = factory.createEntityManager();
em.getTransaction().begin();
Actor actor = new Actor("JENIFFER", "ANISTON", Gender.FEMALE, "FEBRUARY 11, 1969");
em.persist(actor);
Category category = new Category("ADVENTURE");
em.persist(category);
category = new Category("ACTION");
em.persist(category);
category = new Category("COMEDY");
em.persist(category);
category = new Category("HORROR");
em.persist(category);
em.getTransaction().commit();
em.close();
factory.close();
}
Aggregations