@Test public void testDeleteQuote() { countRecords(); Iterator<Quote> existingQuotes = quoteRepository.findByQuoteNumber(QUOTE_NUMBER); while (existingQuotes.hasNext()) { quoteRepository.delete(existingQuotes.next()); } countRecords(); }
public Iterator<Quote> findByQuoteNumber(String quoteNumber) { Pattern regExp = Pattern.compile(quoteNumber + ".*", Pattern.CASE_INSENSITIVE); return ds.find(entityClazz).filter("quoteNumber", regExp).iterator(); }
QuoteRepository extends BasicDAO<Quote, ObjectId> { public Iterator<Quote> findByQuoteNumber(String quoteNumber) { Pattern regExp = Pattern.compile(quoteNumber + ".*", Pattern.CASE_INSENSITIVE); return ds.find(entityClazz).filter("quoteNumber", regExp).iterator(); } }
QuoteRepository extends BasicDAO<Quote, ObjectId> { public Iterator<Quote> findByQuoteNumber(String quoteNumber) { Pattern regExp = Pattern.compile(quoteNumber + ".*", Pattern.CASE_INSENSITIVE); return ds.find(entityClazz).filter("quoteNumber", regExp).iterator(); } QuoteRepository(Mongo mongo, Morphia morphia, String dbName); }
QuoteRepository extends BasicDAO<Quote, ObjectId> { public Iterator<Quote> findByQuoteNumber(String quoteNumber) { Pattern regExp = Pattern.compile(quoteNumber + ".*", Pattern.CASE_INSENSITIVE); return ds.find(entityClazz).filter("quoteNumber", regExp).iterator(); } QuoteRepository(Mongo mongo, Morphia morphia, String dbName); Iterator<Quote> findByQuoteNumber(String quoteNumber); }
QuoteRepository extends BasicDAO<Quote, ObjectId> { public Iterator<Quote> findByQuoteNumber(String quoteNumber) { Pattern regExp = Pattern.compile(quoteNumber + ".*", Pattern.CASE_INSENSITIVE); return ds.find(entityClazz).filter("quoteNumber", regExp).iterator(); } QuoteRepository(Mongo mongo, Morphia morphia, String dbName); Iterator<Quote> findByQuoteNumber(String quoteNumber);  }