public static final class Insert.RowBuilder extends java.lang.Object
Insert.Builder.row()
. This builder
allows adding a row with named columns to an Insert:
Insert insert = Insert.into("CLIENT") .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) .end() .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) .end() .build();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.Modifier and Type | Method and Description |
---|---|
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.
|
Insert.Builder |
times(int times)
Ends the row, adds it to the Insert Builder the given amount of times, and returns it, for chaining.
|
public Insert.RowBuilder column(@Nonnull java.lang.String name, java.lang.Object value)
name
- the name of the column, which must match with a column name defined in the Insert Buildervalue
- the value of the column for the constructed rowjava.lang.IllegalArgumentException
- if the given name is not the name of one of the columns to insertpublic Insert.Builder end()
public Insert.Builder times(int times)
times
- the number of rows to add. Must be >= 0. If zero, no row is added.