@Test public void testUpdate() throws Exception { IDataSet db = database( support.loadFlatXmlDataStream(getClass(), "user.xml"), support.loadFlatXmlDataStream(getClass(), "wf_job.xml") ); support.cleanInsert(support.getConnection(tx), db); tx.commit(); Job job = dao.find(BigDecimal.ONE); job.setLabel("new label"); final BigDecimal parentId = BigDecimal.valueOf(2); job.setParentId(parentId); job.setTimestamp(new Timestamp(job.getTimestamp().getTime())); dao.update(job); tx.commit(); Job result = dao.find(BigDecimal.ONE); assertEquals("new label", result.getLabel()); assertEquals(parentId, result.getParentId()); }
@Override public void update(Job job) throws ConcurrentModificationException { Connection c = getConnection(); DBRecord r = new DBRecord(); if (job.getId() == null) { r.create(tableJob); } else { r.read(tableJob, job.getId(), c); } r.setBeanValues(job); try { r.setModified(tableJob.label, true); r.update(c); } catch (RecordUpdateInvalidException ex) { throw new ConcurrentModificationException(ex); } r.getBeanProperties(job); }
EmpireWorkflowJobDao extends EmpireDao implements WorkflowJobDao { @Override public void update(Job job) throws ConcurrentModificationException { Connection c = getConnection(); DBRecord r = new DBRecord(); if (job.getId() == null) { r.create(tableJob); } else { r.read(tableJob, job.getId(), c); } r.setBeanValues(job); try { r.setModified(tableJob.label, true); r.update(c); } catch (RecordUpdateInvalidException ex) { throw new ConcurrentModificationException(ex); } r.getBeanProperties(job); } }
EmpireWorkflowJobDao extends EmpireDao implements WorkflowJobDao { @Override public void update(Job job) throws ConcurrentModificationException { Connection c = getConnection(); DBRecord r = new DBRecord(); if (job.getId() == null) { r.create(tableJob); } else { r.read(tableJob, job.getId(), c); } r.setBeanValues(job); try { r.setModified(tableJob.label, true); r.update(c); } catch (RecordUpdateInvalidException ex) { throw new ConcurrentModificationException(ex); } r.getBeanProperties(job); } EmpireWorkflowJobDao(ProarcDatabase db); }
EmpireWorkflowJobDao extends EmpireDao implements WorkflowJobDao { @Override public void update(Job job) throws ConcurrentModificationException { Connection c = getConnection(); DBRecord r = new DBRecord(); if (job.getId() == null) { r.create(tableJob); } else { r.read(tableJob, job.getId(), c); } r.setBeanValues(job); try { r.setModified(tableJob.label, true); r.update(c); } catch (RecordUpdateInvalidException ex) { throw new ConcurrentModificationException(ex); } r.getBeanProperties(job); } EmpireWorkflowJobDao(ProarcDatabase db); @Override Job create(); @Override void update(Job job); @Override Job find(BigDecimal id); @Override List<JobView> view(JobFilter filter); }
EmpireWorkflowJobDao extends EmpireDao implements WorkflowJobDao { @Override public void update(Job job) throws ConcurrentModificationException { Connection c = getConnection(); DBRecord r = new DBRecord(); if (job.getId() == null) { r.create(tableJob); } else { r.read(tableJob, job.getId(), c); } r.setBeanValues(job); try { r.setModified(tableJob.label, true); r.update(c); } catch (RecordUpdateInvalidException ex) { throw new ConcurrentModificationException(ex); } r.getBeanProperties(job); } EmpireWorkflowJobDao(ProarcDatabase db); @Override Job create(); @Override void update(Job job); @Override Job find(BigDecimal id); @Override List<JobView> view(JobFilter filter);  }