@Test public void testCreate() throws Exception { final SourceDocumentProcessingStatistics sourceDocumentProcessingStatistics = new SourceDocumentProcessingStatistics(new Date(), new Date(), true, null, null, new ReferenceOwner("1", "1", "1"), null, "", "", 100, "", 150*1024l, 50l, 0l, 0l, "", null, "",null); assertNotNull(sourceDocumentProcessingStatistics.getId()); sourceDocumentProcessingStatisticsDao.create(sourceDocumentProcessingStatistics, WriteConcern.NONE); assertEquals(sourceDocumentProcessingStatistics.getHttpResponseContentSizeInBytes(), sourceDocumentProcessingStatisticsDao.read( sourceDocumentProcessingStatistics.getId()).getHttpResponseContentSizeInBytes()); sourceDocumentProcessingStatisticsDao.delete(sourceDocumentProcessingStatistics.getId()); }
@Override public boolean create(SourceDocumentProcessingStatistics sourceDocumentProcessingStatistics, WriteConcern writeConcern) { if (read(sourceDocumentProcessingStatistics.getId()) == null) { datastore.save(sourceDocumentProcessingStatistics); return true; } else { return false; } }
SourceDocumentProcessingStatisticsDaoImpl implements SourceDocumentProcessingStatisticsDao { @Override public boolean create(SourceDocumentProcessingStatistics sourceDocumentProcessingStatistics, WriteConcern writeConcern) { if (read(sourceDocumentProcessingStatistics.getId()) == null) { datastore.save(sourceDocumentProcessingStatistics); return true; } else { return false; } } }
SourceDocumentProcessingStatisticsDaoImpl implements SourceDocumentProcessingStatisticsDao { @Override public boolean create(SourceDocumentProcessingStatistics sourceDocumentProcessingStatistics, WriteConcern writeConcern) { if (read(sourceDocumentProcessingStatistics.getId()) == null) { datastore.save(sourceDocumentProcessingStatistics); return true; } else { return false; } } SourceDocumentProcessingStatisticsDaoImpl(Datastore datastore); }
SourceDocumentProcessingStatisticsDaoImpl implements SourceDocumentProcessingStatisticsDao { @Override public boolean create(SourceDocumentProcessingStatistics sourceDocumentProcessingStatistics, WriteConcern writeConcern) { if (read(sourceDocumentProcessingStatistics.getId()) == null) { datastore.save(sourceDocumentProcessingStatistics); return true; } else { return false; } } SourceDocumentProcessingStatisticsDaoImpl(Datastore datastore); @Override Long getCount(); @Override boolean create(SourceDocumentProcessingStatistics sourceDocumentProcessingStatistics, WriteConcern writeConcern); @Override SourceDocumentProcessingStatistics read(String id); @Override List<SourceDocumentProcessingStatistics> read(List<String> ids); @Override boolean update(SourceDocumentProcessingStatistics sourceDocumentProcessingStatistics, WriteConcern writeConcern); @Override com.google.code.morphia.Key<SourceDocumentProcessingStatistics> createOrModify(SourceDocumentProcessingStatistics sourceDocumentProcessingStatistics, WriteConcern writeConcern); @Override Iterable<com.google.code.morphia.Key<SourceDocumentProcessingStatistics>> createOrModify(Collection<SourceDocumentProcessingStatistics> sourceDocumentProcessingStatistics,
                                                                                                    WriteConcern writeConcern); @Override WriteResult delete(String id); @Override SourceDocumentProcessingStatistics findBySourceDocumentReferenceAndJobId(String docId, String jobId); @Override List<SourceDocumentProcessingStatistics> findByRecordID(String recordID); @Override Map<ProcessingState, Long> countNumberOfDocumentsWithState(); @Override List<SourceDocumentProcessingStatistics> deactivateDocuments(List<String> sourceDocumentReferenceIds, WriteConcern writeConcern); @Override List<SourceDocumentProcessingStatistics> findByExecutionIdAndState(String executionId, List<ProcessingState> states); }
SourceDocumentProcessingStatisticsDaoImpl implements SourceDocumentProcessingStatisticsDao { @Override public boolean create(SourceDocumentProcessingStatistics sourceDocumentProcessingStatistics, WriteConcern writeConcern) { if (read(sourceDocumentProcessingStatistics.getId()) == null) { datastore.save(sourceDocumentProcessingStatistics); return true; } else { return false; } } SourceDocumentProcessingStatisticsDaoImpl(Datastore datastore); @Override Long getCount(); @Override boolean create(SourceDocumentProcessingStatistics sourceDocumentProcessingStatistics, WriteConcern writeConcern); @Override SourceDocumentProcessingStatistics read(String id); @Override List<SourceDocumentProcessingStatistics> read(List<String> ids); @Override boolean update(SourceDocumentProcessingStatistics sourceDocumentProcessingStatistics, WriteConcern writeConcern); @Override com.google.code.morphia.Key<SourceDocumentProcessingStatistics> createOrModify(SourceDocumentProcessingStatistics sourceDocumentProcessingStatistics, WriteConcern writeConcern); @Override Iterable<com.google.code.morphia.Key<SourceDocumentProcessingStatistics>> createOrModify(Collection<SourceDocumentProcessingStatistics> sourceDocumentProcessingStatistics,
                                                                                                    WriteConcern writeConcern); @Override WriteResult delete(String id); @Override SourceDocumentProcessingStatistics findBySourceDocumentReferenceAndJobId(String docId, String jobId); @Override List<SourceDocumentProcessingStatistics> findByRecordID(String recordID); @Override Map<ProcessingState, Long> countNumberOfDocumentsWithState(); @Override List<SourceDocumentProcessingStatistics> deactivateDocuments(List<String> sourceDocumentReferenceIds, WriteConcern writeConcern); @Override List<SourceDocumentProcessingStatistics> findByExecutionIdAndState(String executionId, List<ProcessingState> states);  }