Merge's DSL API.
Example:
DSLContext create = DSL.using(configuration);
create.mergeInto(table)
.using(select)
.on(condition)
.whenMatchedThenUpdate()
.set(field1, value1)
.set(field2, value2)
.whenNotMatchedThenInsert(field1, field2)
.values(value1, 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 MergeMatchedSetMoreStep | set(Field<T> field, T value)
Deprecated
as a consequence of
Set values for Field and MergeMatchedSetMoreStep being deprecated.
UPDATE in the MERGE statement's
WHEN MATCHED clause.
|
| public <T> @NotNull MergeMatchedSetMoreStep | set(Field<T> field, Field<T> value)
Deprecated
as a consequence of
Set values for Field and MergeMatchedSetMoreStep being deprecated.
UPDATE in the MERGE statement's
WHEN MATCHED clause.
|
| public <T> @NotNull MergeMatchedSetMoreStep | |
| public @NotNull MergeMatchedSetMoreStep | set(Map<?, ?> map)
Deprecated
as a consequence of
Set multiple values for MergeMatchedSetMoreStep being deprecated.
UPDATE in the MERGE
statement's WHEN MATCHED clause.
|
| public @NotNull MergeMatchedSetMoreStep | set(Record record)
Deprecated
as a consequence of
Set multiple values for MergeMatchedSetMoreStep being deprecated.
UPDATE in the MERGE
statement's WHEN MATCHED clause.
|
| public <T> @NotNull MergeMatchedSetMoreStep | setNull(Field<T> field)
Deprecated
as a consequence of
Set a Field and MergeMatchedSetMoreStep being deprecated.
null value for UPDATE in the
MERGE statement's WHEN MATCHED clause.
|
| set | back to summary |
|---|---|
| public <T> @NotNull MergeMatchedSetMoreStep Deprecated as a consequence of Set values for | |
| set | back to summary |
|---|---|
| public <T> @NotNull MergeMatchedSetMoreStep Deprecated as a consequence of Set values for | |
| set | back to summary |
|---|---|
| public <T> @NotNull MergeMatchedSetMoreStep Deprecated as a consequence of Set values for | |
| set | back to summary |
|---|---|
| public @NotNull MergeMatchedSetMoreStep 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 MergeMatchedSetMoreStep Deprecated as a consequence of Set multiple values for
This is the same as calling | |
| setNull | back to summary |
|---|---|
| public <T> @NotNull MergeMatchedSetMoreStep Deprecated as a consequence of Set a
This method is convenience for calling | |