Deprecated
as a consequence of InsertReturningStep being deprecated. See corresponding docs for further information.
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 @NotNull InsertOnConflictWhereIndexPredicateStep | onConflict(Field<?>... keys)
Deprecated
as a consequence of
Add an Field being deprecated.
ON CONFLICT clause to this INSERT statement.
|
| public @NotNull InsertOnConflictWhereIndexPredicateStep | |
| public @NotNull InsertReturningStep | onConflictDoNothing()
Deprecated
as a consequence of
Add an InsertReturningStep being deprecated.
ON CONFLICT DO NOTHING clause to this INSERT statement.
|
| public @NotNull InsertOnConflictDoUpdateStep | onConflictOnConstraint(Constraint constraint)
Deprecated
as a consequence of
Add a Constraint being deprecated.
ON CONFLICT ON CONSTRAINT clause to this INSERT statement.
|
| public @NotNull InsertOnConflictDoUpdateStep | onConflictOnConstraint(Name constraint)
Add a |
| public @NotNull InsertOnConflictDoUpdateStep | onConflictOnConstraint(UniqueKey<R> constraint)
Add a |
| public @NotNull InsertReturningStep | onDuplicateKeyIgnore()
Deprecated
as a consequence of
Add an InsertReturningStep being deprecated.
ON DUPLICATE KEY IGNORE clause to this INSERT statement.
|
| public @NotNull InsertOnDuplicateSetStep |
| onConflict | back to summary |
|---|---|
| public @NotNull InsertOnConflictWhereIndexPredicateStep Deprecated as a consequence of Add an
Only
| |
| onConflict | back to summary |
|---|---|
| public @NotNull InsertOnConflictWhereIndexPredicateStep Add an
Only
| |
| onConflictDoNothing | back to summary |
|---|---|
| public @NotNull InsertReturningStep Deprecated as a consequence of Add an
Only
| |
| onConflictOnConstraint | back to summary |
|---|---|
| public @NotNull InsertOnConflictDoUpdateStep Deprecated as a consequence of Add a | |
| onConflictOnConstraint | back to summary |
|---|---|
| public @NotNull InsertOnConflictDoUpdateStep Add a | |
| onConflictOnConstraint | back to summary |
|---|---|
| public @NotNull InsertOnConflictDoUpdateStep Add a
| |
| onDuplicateKeyIgnore | back to summary | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public @NotNull InsertReturningStep Deprecated as a consequence of Add an
This will try to This clause is not actually supported in this form by any database, but can be emulated as such:
| |||||||||||
| onDuplicateKeyUpdate | back to summary |
|---|---|
| public @NotNull InsertOnDuplicateSetStep Add an
This will try to
MySQL natively implements this type of clause. jOOQ can
emulate this clause using a
H2 supports this clause in MySQL mode. | |