Codota Logo
MongoItemWriter.setDelete
Code IndexAdd Codota to your IDE (free)

How to use
setDelete
method
in
org.springframework.batch.item.data.MongoItemWriter

Best Java code snippets using org.springframework.batch.item.data.MongoItemWriter.setDelete (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-batch

/**
 * Validates and builds a {@link MongoItemWriter}.
 *
 * @return a {@link MongoItemWriter}
 */
public MongoItemWriter<T> build() {
  Assert.notNull(this.template, "template is required.");
  MongoItemWriter<T> writer = new MongoItemWriter<>();
  writer.setTemplate(this.template);
  writer.setDelete(this.delete);
  writer.setCollection(this.collection);
  return writer;
}
origin: spring-projects/spring-batch

@Test
public void testRemoveNoTransactionNoCollection() throws Exception {
  writer.setDelete(true);
  List<Object> items = new ArrayList<Object>() {{
    add(new Object());
    add(new Object());
  }};
  writer.write(items);
  verify(template).remove(items.get(0));
  verify(template).remove(items.get(1));
}
origin: spring-projects/spring-batch

@Test
public void testRemoveNoTransactionWithCollection() throws Exception {
  writer.setDelete(true);
  List<Object> items = new ArrayList<Object>() {{
    add(new Object());
    add(new Object());
  }};
  writer.setCollection("collection");
  writer.write(items);
  verify(template).remove(items.get(0), "collection");
  verify(template).remove(items.get(1), "collection");
}

origin: apache/servicemix-bundles

/**
 * Validates and builds a {@link MongoItemWriter}.
 *
 * @return a {@link MongoItemWriter}
 */
public MongoItemWriter<T> build() {
  Assert.notNull(this.template, "template is required.");
  MongoItemWriter<T> writer = new MongoItemWriter<>();
  writer.setTemplate(this.template);
  writer.setDelete(this.delete);
  writer.setCollection(this.collection);
  return writer;
}
org.springframework.batch.item.dataMongoItemWritersetDelete

Javadoc

Indicates if the items being passed to the writer are to be saved or removed from the data store. If set to false (default), the items will be saved. If set to true, the items will be removed.

Popular methods of MongoItemWriter

  • <init>
  • setCollection
    Set the name of the Mongo collection to be written to.
  • setTemplate
    Set the MongoOperations to be used to save items to be written.
  • doWrite
    Performs the actual write to the store via the template. This can be overridden by a subclass if nec
  • getCurrentBuffer
  • transactionActive
  • afterPropertiesSet
  • write
    If a transaction is active, buffer items to be written just before commit. Otherwise write items usi

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • onRequestPermissionsResult (Fragment)
  • runOnUiThread (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now