Class Insert.RowBuilder

  extended by com.ninja_squad.dbsetup.operation.Insert.RowBuilder
Enclosing class:

public static final class Insert.RowBuilder
extends java.lang.Object

A row builder, constructed with Insert.Builder.row(). This builder allows adding a row with named columns to an Insert:

   Insert insert =
             .columns("CLIENT_ID", "FIRST_NAME", "LAST_NAME", "DATE_OF_BIRTH", "CLIENT_TYPE")
             .row().column("CLIENT_ID", 1L)
                   .column("FIRST_NAME", "John")
                   .column("LAST_NAME", "Doe")
                   .column("DATE_OF_BIRTH", "1975-07-19")
                   .column("CLIENT_TYPE", ClientType.NORMAL)
             .row().column("CLIENT_ID", 2L)
                   .column("FIRST_NAME", "Jack")
                   .column("LAST_NAME", "Smith")
                   .column("DATE_OF_BIRTH", "1969-08-22")
                   .column("CLIENT_TYPE", ClientType.HIGH_PRIORITY)
You may omit the call to columns(). In that case, the columns of the Insert will be the columns specified in the first added row.

Method Summary
 Insert.RowBuilder column(java.lang.String name, java.lang.Object value)
          Adds a new named column to the row.
 Insert.Builder end()
          Ends the row, adds it to the Insert Builder and returns it, for chaining.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail


public Insert.RowBuilder column(@Nonnull
                                java.lang.String name,
                                java.lang.Object value)
Adds a new named column to the row. If a previous value has already been added for the same column, it's replaced by this new value.

name - the name of the column, which must match with a column name defined in the Insert Builder
value - the value of the column for the constructed row
this builder, for chaining
java.lang.IllegalArgumentException - if the given name is not the name of one of the columns to insert


public Insert.Builder end()
Ends the row, adds it to the Insert Builder and returns it, for chaining.

the Insert Builder