@Test public void testCreate(){ JobInstance instance = new JobInstance(); instance.setJobId(1L); instance.setStatus(JobInstanceStatus.NEW.value()); instance.setStartTime(new Date()); instance.setServer("127.0.0.1:1122"); assertTrue(jobInstanceManager.create(instance)); }
public Boolean create(JobInstance instance){ if (jobInstanceDao.save(instance)){ if (jobInstanceDao.bindJob(instance.getJobId(), instance.getId())){ return Boolean.TRUE; } else { jobInstanceDao.delete(instance.getId()); } } return Boolean.FALSE; }
JobInstanceManager { public Boolean create(JobInstance instance){ if (jobInstanceDao.save(instance)){ if (jobInstanceDao.bindJob(instance.getJobId(), instance.getId())){ return Boolean.TRUE; } else { jobInstanceDao.delete(instance.getId()); } } return Boolean.FALSE; } }
JobInstanceManager { public Boolean create(JobInstance instance){ if (jobInstanceDao.save(instance)){ if (jobInstanceDao.bindJob(instance.getJobId(), instance.getId())){ return Boolean.TRUE; } else { jobInstanceDao.delete(instance.getId()); } } return Boolean.FALSE; }  }
JobInstanceManager { public Boolean create(JobInstance instance){ if (jobInstanceDao.save(instance)){ if (jobInstanceDao.bindJob(instance.getJobId(), instance.getId())){ return Boolean.TRUE; } else { jobInstanceDao.delete(instance.getId()); } } return Boolean.FALSE; }  Boolean create(JobInstance instance); Boolean deleteById(Long jobInstanceId); Boolean deleteByJobId(Long jobId); }
JobInstanceManager { public Boolean create(JobInstance instance){ if (jobInstanceDao.save(instance)){ if (jobInstanceDao.bindJob(instance.getJobId(), instance.getId())){ return Boolean.TRUE; } else { jobInstanceDao.delete(instance.getId()); } } return Boolean.FALSE; }  Boolean create(JobInstance instance); Boolean deleteById(Long jobInstanceId); Boolean deleteByJobId(Long jobId);  }