Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Integer addEmployee(EmployeeEntity employee) {
- EntityManagerFactory emf = null;
- EntityManager em = null;
- try {
- emf = Persistence.createEntityManagerFactory("Employee_Mgmt");
- em = emf.createEntityManager();
- EntityTransaction et = em.getTransaction();
- et.begin();
- em.persist(employee);
- et.commit();
- return employee.getRegId();
- } finally {
- if (em != null)
- em.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement