All pastes #272043 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-12-08 17:52 UTC
rendered paste body
public class Main {
  public static void main(String[] args) {
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("model");
    Employee employee = new Employee();

    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
    em.persist(employee);
    em.getTransaction().commit();
    em.close();
    //    
    //
    // EntityManager em = emf.createEntityManager();
    // em.getTransaction().begin();
    // Employee employee = em.find(Employee.class, new Long(2));
    //
    // System.out.println(employee);

//    em.close();
    emf.close();
  }
}