@Test public void createOnProcessTest() throws Exception { String DESC = "Table"; Product p = new Product(DESC, 10f); startJPAWIHProcess(JPAWorkItemHandler.CREATE_ACTION, p); UserTransaction ut = getUserTransaction(); ut.begin(); EntityManager em = emf.createEntityManager(); TypedQuery<Product> products = em.createQuery("select p from Product p where p.description = :desc", Product.class); products.setParameter("desc", DESC); List<Product> resultList = products.getResultList(); Product result = resultList.iterator().next(); assertEquals(DESC, result.getDescription()); em.remove(result); em.flush(); em.close(); ut.commit(); }
public void close() { emf.close(); }
JPAWorkItemHandler extends AbstractLogOrThrowWorkItemHandler implements Cacheable { public void close() { emf.close(); } }
JPAWorkItemHandler extends AbstractLogOrThrowWorkItemHandler implements Cacheable { public void close() { emf.close(); } JPAWorkItemHandler(String persistenceUnit);  JPAWorkItemHandler(String persistenceUnit,
                              ClassLoader classloader); }
JPAWorkItemHandler extends AbstractLogOrThrowWorkItemHandler implements Cacheable { public void close() { emf.close(); } JPAWorkItemHandler(String persistenceUnit);  JPAWorkItemHandler(String persistenceUnit,
                              ClassLoader classloader); void executeWorkItem(WorkItem wi,
                                WorkItemManager wim); void close(); void abortWorkItem(WorkItem wi,
                              WorkItemManager wim); }
JPAWorkItemHandler extends AbstractLogOrThrowWorkItemHandler implements Cacheable { public void close() { emf.close(); } JPAWorkItemHandler(String persistenceUnit);  JPAWorkItemHandler(String persistenceUnit,
                              ClassLoader classloader); void executeWorkItem(WorkItem wi,
                                WorkItemManager wim); void close(); void abortWorkItem(WorkItem wi,
                              WorkItemManager wim); static final String P_RESULT; static final String P_TYPE; static final String P_ID; static final String P_ENTITY; static final String P_ACTION; static final String P_QUERY; static final String P_QUERY_PARAMS; static final String P_QUERY_RESULTS; static final String CREATE_ACTION; static final String UPDATE_ACTION; static final String GET_ACTION; static final String DELETE_ACTION; static final String QUERY_ACTION; }