@Test public void testUpdate() throws Exception { final ProcessingJob processingJob = new ProcessingJob(1, new Date(), new ReferenceOwner("1", "1", "1"), null, JobState.READY, null, "", null); processingJobDao.create(processingJob, WriteConcern.NONE); final ProcessingJob updatedProcessingJob = processingJob.withState(JobState.FINISHED); assertNotEquals(updatedProcessingJob.getState(), processingJobDao.read(processingJob.getId()).getState()); assertTrue(processingJobDao.update(updatedProcessingJob, WriteConcern.NONE)); assertEquals(updatedProcessingJob.getState(), processingJobDao.read(processingJob.getId()).getState()); processingJobDao.delete(updatedProcessingJob.getId()); final ProcessingJob newProcessingJob = new ProcessingJob(1, new Date(), new ReferenceOwner("1", "1", "1"), null, JobState.READY, null, "", null); assertFalse(processingJobDao.update(newProcessingJob, WriteConcern.NONE)); }
@Override public boolean update(ProcessingJob processingJob, WriteConcern writeConcern) { if (read(processingJob.getId()) != null) { datastore.save(processingJob, writeConcern); return true; } return false; }
ProcessingJobDaoImpl implements ProcessingJobDao { @Override public boolean update(ProcessingJob processingJob, WriteConcern writeConcern) { if (read(processingJob.getId()) != null) { datastore.save(processingJob, writeConcern); return true; } return false; } }
ProcessingJobDaoImpl implements ProcessingJobDao { @Override public boolean update(ProcessingJob processingJob, WriteConcern writeConcern) { if (read(processingJob.getId()) != null) { datastore.save(processingJob, writeConcern); return true; } return false; } ProcessingJobDaoImpl(Datastore datastore); }
ProcessingJobDaoImpl implements ProcessingJobDao { @Override public boolean update(ProcessingJob processingJob, WriteConcern writeConcern) { if (read(processingJob.getId()) != null) { datastore.save(processingJob, writeConcern); return true; } return false; } ProcessingJobDaoImpl(Datastore datastore); @Override Long getCount(); @Override boolean create(ProcessingJob processingJob, WriteConcern writeConcern); @Override com.google.code.morphia.Key<ProcessingJob> createOrModify(
			ProcessingJob processingJobs, WriteConcern writeConcern); @Override Iterable<com.google.code.morphia.Key<ProcessingJob>> createOrModify(
			Collection<ProcessingJob> processingJobs, WriteConcern writeConcern); @Override ProcessingJob read(String id); @Override boolean update(ProcessingJob processingJob, WriteConcern writeConcern); @Override WriteResult delete(String id); @Override List<ProcessingJob> getJobsWithState(JobState jobState, Page page); @Override void modifyStateOfJobsWithIds(JobState newJobState,
			final List<String> jobIds); @Override void modifyStateOfJobs(JobState oldJobState, JobState newJobState); Map<String, Integer> getIpDistribution(); @Override List<ProcessingJob> getDiffusedJobsWithState(
			JobPriority jobPriority, JobState jobState, Page page,
			Map<String, Integer> ipDistribution); @Override List<ProcessingJob> deactivateJobs(final ReferenceOwner owner,
			final WriteConcern writeConcern); @Override PagedElements<ProcessingJob> findJobsByCollectionIdAndState(
			final Set<String> collectionIds, final Set<JobState> states,
			final Page pageConfiguration); @Override Map<String, JobStatistics> findJobsByCollectionId(String collectionId); }
ProcessingJobDaoImpl implements ProcessingJobDao { @Override public boolean update(ProcessingJob processingJob, WriteConcern writeConcern) { if (read(processingJob.getId()) != null) { datastore.save(processingJob, writeConcern); return true; } return false; } ProcessingJobDaoImpl(Datastore datastore); @Override Long getCount(); @Override boolean create(ProcessingJob processingJob, WriteConcern writeConcern); @Override com.google.code.morphia.Key<ProcessingJob> createOrModify(
			ProcessingJob processingJobs, WriteConcern writeConcern); @Override Iterable<com.google.code.morphia.Key<ProcessingJob>> createOrModify(
			Collection<ProcessingJob> processingJobs, WriteConcern writeConcern); @Override ProcessingJob read(String id); @Override boolean update(ProcessingJob processingJob, WriteConcern writeConcern); @Override WriteResult delete(String id); @Override List<ProcessingJob> getJobsWithState(JobState jobState, Page page); @Override void modifyStateOfJobsWithIds(JobState newJobState,
			final List<String> jobIds); @Override void modifyStateOfJobs(JobState oldJobState, JobState newJobState); Map<String, Integer> getIpDistribution(); @Override List<ProcessingJob> getDiffusedJobsWithState(
			JobPriority jobPriority, JobState jobState, Page page,
			Map<String, Integer> ipDistribution); @Override List<ProcessingJob> deactivateJobs(final ReferenceOwner owner,
			final WriteConcern writeConcern); @Override PagedElements<ProcessingJob> findJobsByCollectionIdAndState(
			final Set<String> collectionIds, final Set<JobState> states,
			final Page pageConfiguration); @Override Map<String, JobStatistics> findJobsByCollectionId(String collectionId);  }