public interface InsertSetStep<R extends Record>
Insert
's alternative DSL API.
Example:
Factory create = new Factory();
create.insertInto(table)
.set(field1, value1)
.set(field2, value2)
.newRecord()
.set(field1, value3)
.set(field2, value4)
.onDuplicateKeyUpdate()
.set(field1, value1)
.set(field2, value2)
.execute();
Modifier and Type | Method and Description |
---|---|
Insert<R> |
select(Select<?> select)
Use a
SELECT statement as the source of values for the
INSERT statement
This variant of the INSERT .. |
<T> InsertSetMoreStep<R> |
set(Field<T> field,
Field<T> value)
Set a value for a field in the
UPDATE statement |
<T> InsertSetMoreStep<R> |
set(Field<T> field,
T value)
Set a value for a field in the
UPDATE statement |
InsertSetMoreStep<R> |
set(Map<? extends Field<?>,?> map)
Set a value for a field in the
UPDATE statement
Please assure that key/value pairs have matching <T>
types. |
InsertValuesStep<R> |
values(Collection<?> values)
Add values to the insert statement with implicit field names
|
InsertValuesStep<R> |
values(Field<?>... values)
Add values to the insert statement with implicit field names
|
InsertValuesStep<R> |
values(Object... values)
Add values to the insert statement with implicit field names
|
@Support <T> InsertSetMoreStep<R> set(Field<T> field, T value)
UPDATE
statement@Support <T> InsertSetMoreStep<R> set(Field<T> field, Field<T> value)
UPDATE
statement@Support InsertSetMoreStep<R> set(Map<? extends Field<?>,?> map)
UPDATE
statement
Please assure that key/value pairs have matching <T>
types. Values can either be of type <T>
or
Field<T>
@Support InsertValuesStep<R> values(Object... values)
@Support InsertValuesStep<R> values(Field<?>... values)
@Support InsertValuesStep<R> values(Collection<?> values)
@Support Insert<R> select(Select<?> select)
SELECT
statement as the source of values for the
INSERT
statement
This variant of the INSERT .. SELECT
statement does not
allow for specifying a subset of the fields inserted into. It will insert
into all fields of the table specified in the INTO
clause.
Use FactoryOperations.insertInto(Table, Field...)
or
FactoryOperations.insertInto(Table, Collection)
instead, to
define a field set for insertion.
Copyright © 2013. All Rights Reserved.