Insert's DSL API.
Example:
DSLContext create = DSL.using(configuration);
create.insertInto(table, field1, field2)
.values(value1, value2)
.values(value3, value4)
.onDuplicateKeyUpdate()
.set(field1, value1)
.set(field2, value2)
.execute();
XYZ*Step types directly from client code
It is usually not recommended to reference any XYZ*Step types
directly from client code, or assign them to local variables. When writing
dynamic SQL, creating a statement's components dynamically, and passing them
to the DSL API statically is usually a better choice. See the manual's
section about dynamic SQL for details: https://www.jooq.org/doc/latest/manual/sql-building/dynamic-sql.
Drawbacks of referencing the XYZ*Step types directly:
| Modifier and Type | Method and Description |
|---|---|
| public <T> @NotNull InsertOnDuplicateSetMoreStep | set(Field<T> field, T value)
Deprecated
as a consequence of
Set values for Field and InsertOnDuplicateSetMoreStep being deprecated.
UPDATE in the INSERT statement's
ON DUPLICATE KEY UPDATE or
ON CONFLICT … DO UPDATE clause.
|
| public <T> @NotNull InsertOnDuplicateSetMoreStep | set(Field<T> field, Field<T> value)
Deprecated
as a consequence of
Set values for Field and InsertOnDuplicateSetMoreStep being deprecated.
UPDATE in the INSERT statement's
ON DUPLICATE KEY UPDATE or
ON CONFLICT … DO UPDATE clause.
|
| public <T> @NotNull InsertOnDuplicateSetMoreStep | |
| public @NotNull InsertOnDuplicateSetMoreStep | set(Map<?, ?> map)
Deprecated
as a consequence of
Set multiple values for InsertOnDuplicateSetMoreStep being deprecated.
UPDATE in the INSERT
statement's ON DUPLICATE KEY UPDATE or
ON CONFLICT … DO UPDATE clause.
|
| public @NotNull InsertOnDuplicateSetMoreStep | set(Record record)
Deprecated
as a consequence of
Set multiple values for InsertOnDuplicateSetMoreStep being deprecated.
UPDATE in the INSERT
statement's ON DUPLICATE KEY UPDATE or
ON CONFLICT … DO UPDATE clause.
|
| public @NotNull InsertOnDuplicateSetMoreStep | setAllToExcluded()
Deprecated
as a consequence of
Sets all columns from the insert column list to
InsertOnDuplicateSetMoreStep being deprecated.
DSL#excluded(Field).
|
| public <T> @NotNull InsertOnDuplicateSetMoreStep | setNull(Field<T> field)
Deprecated
as a consequence of
Set a Field and InsertOnDuplicateSetMoreStep being deprecated.
null value for UPDATE in the
INSERT statement's ON DUPLICATE KEY UPDATE or
ON CONFLICT … DO UPDATE clause.
|
| set | back to summary |
|---|---|
| public <T> @NotNull InsertOnDuplicateSetMoreStep Deprecated as a consequence of Set values for | |
| set | back to summary |
|---|---|
| public <T> @NotNull InsertOnDuplicateSetMoreStep Deprecated as a consequence of Set values for | |
| set | back to summary |
|---|---|
| public <T> @NotNull InsertOnDuplicateSetMoreStep Deprecated as a consequence of Set values for | |
| set | back to summary |
|---|---|
| public @NotNull InsertOnDuplicateSetMoreStep Deprecated as a consequence of Set multiple values for
Keys can either be of type
Values can either be of type | |
| set | back to summary |
|---|---|
| public @NotNull InsertOnDuplicateSetMoreStep Deprecated as a consequence of Set multiple values for
This is the same as calling | |
| setAllToExcluded | back to summary |
|---|---|
| public @NotNull InsertOnDuplicateSetMoreStep Deprecated as a consequence of Sets all columns from the insert column list to
| |
| setNull | back to summary |
|---|---|
| public <T> @NotNull InsertOnDuplicateSetMoreStep Deprecated as a consequence of Set a
This method is convenience for calling | |