[#8529] Clean up Javadoc for INSERT ... ON CONFLICT
Improves the DSL Javadoc for INSERT ... ON [ CONFLICT | DUPLICATE KEY ]
This commit is contained in:
parent
97f8700abf
commit
56fe33475d
@ -53,7 +53,8 @@ import org.jooq.impl.DSL;
|
||||
* .values(value3, value4)
|
||||
* .onDuplicateKeyUpdate()
|
||||
* .set(field1, value1)
|
||||
* .set(field2, value2)
|
||||
* .where(field2.eq(value5))
|
||||
* .or(field2.eq(value6))
|
||||
* .execute();
|
||||
* </pre></code>
|
||||
* <p>
|
||||
|
||||
@ -58,9 +58,7 @@ import static org.jooq.SQLDialect.POSTGRES_9_5;
|
||||
*
|
||||
* create.insertInto(table, field1, field2)
|
||||
* .values(value1, value2)
|
||||
* .values(value3, value4)
|
||||
* .onDuplicateKeyUpdate()
|
||||
* .set(field1, value1)
|
||||
* .onConflict(field1)
|
||||
* .set(field2, value2)
|
||||
* .execute();
|
||||
* </pre></code>
|
||||
@ -77,7 +75,7 @@ public interface InsertOnConflictDoUpdateStep<R extends Record> {
|
||||
InsertOnDuplicateSetStep<R> doUpdate();
|
||||
|
||||
/**
|
||||
* Add the <code>DO IGNORE</code> clause.
|
||||
* Add the <code>DO NOTHING</code> clause.
|
||||
*/
|
||||
@Support
|
||||
InsertReturningStep<R> doNothing();
|
||||
|
||||
@ -59,7 +59,7 @@ import org.jooq.impl.DSL;
|
||||
* .values(value3, value4)
|
||||
* .onDuplicateKeyUpdate()
|
||||
* .set(field1, value1)
|
||||
* .set(field2, value2)
|
||||
* .where(field2.eq(value5))
|
||||
* .execute();
|
||||
* </pre></code>
|
||||
* <p>
|
||||
@ -86,34 +86,38 @@ import org.jooq.impl.DSL;
|
||||
public interface InsertOnConflictWhereStep<R extends Record> extends InsertReturningStep<R> {
|
||||
|
||||
/**
|
||||
* Add a <code>WHERE</code> clause to the query, connecting them with each
|
||||
* other with {@link Operator#AND}.
|
||||
* Add a <code>WHERE</code> clause to the <code>INSERT</code> statement's
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause.
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, POSTGRES_9_5 })
|
||||
InsertOnConflictConditionStep<R> where(Condition condition);
|
||||
|
||||
/**
|
||||
* Add a <code>WHERE</code> clause to the query, connecting them with each
|
||||
* other with {@link Operator#AND}.
|
||||
* Add a <code>WHERE</code> clause to the <code>INSERT</code> statement's
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause,
|
||||
* connecting them with each other using {@link Operator#AND}.
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, POSTGRES_9_5 })
|
||||
InsertOnConflictConditionStep<R> where(Condition... conditions);
|
||||
|
||||
/**
|
||||
* Add a <code>WHERE</code> clause to the query, connecting them with each
|
||||
* other with {@link Operator#AND}.
|
||||
* Add a <code>WHERE</code> clause to the <code>INSERT</code> statement's
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause,
|
||||
* connecting them with each other using {@link Operator#AND}.
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, POSTGRES_9_5 })
|
||||
InsertOnConflictConditionStep<R> where(Collection<? extends Condition> conditions);
|
||||
|
||||
/**
|
||||
* Add a <code>WHERE</code> clause to the query.
|
||||
* Add a <code>WHERE</code> clause to the <code>INSERT</code> statement's
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause.
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, POSTGRES_9_5 })
|
||||
InsertOnConflictConditionStep<R> where(Field<Boolean> field);
|
||||
|
||||
/**
|
||||
* Add a <code>WHERE</code> clause to the query.
|
||||
* Add a <code>WHERE</code> clause to the <code>INSERT</code> statement's
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause.
|
||||
* <p>
|
||||
* <b>NOTE</b>: When inserting plain SQL into jOOQ objects, you must
|
||||
* guarantee syntax integrity. You may also create the possibility of
|
||||
@ -128,7 +132,8 @@ public interface InsertOnConflictWhereStep<R extends Record> extends InsertRetur
|
||||
InsertOnConflictConditionStep<R> where(SQL sql);
|
||||
|
||||
/**
|
||||
* Add a <code>WHERE</code> clause to the query.
|
||||
* Add a <code>WHERE</code> clause to the <code>INSERT</code> statement's
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause.
|
||||
* <p>
|
||||
* <b>NOTE</b>: When inserting plain SQL into jOOQ objects, you must
|
||||
* guarantee syntax integrity. You may also create the possibility of
|
||||
@ -143,7 +148,8 @@ public interface InsertOnConflictWhereStep<R extends Record> extends InsertRetur
|
||||
InsertOnConflictConditionStep<R> where(String sql);
|
||||
|
||||
/**
|
||||
* Add a <code>WHERE</code> clause to the query.
|
||||
* Add a <code>WHERE</code> clause to the <code>INSERT</code> statement's
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause.
|
||||
* <p>
|
||||
* <b>NOTE</b>: When inserting plain SQL into jOOQ objects, you must
|
||||
* guarantee syntax integrity. You may also create the possibility of
|
||||
@ -159,7 +165,8 @@ public interface InsertOnConflictWhereStep<R extends Record> extends InsertRetur
|
||||
InsertOnConflictConditionStep<R> where(String sql, Object... bindings);
|
||||
|
||||
/**
|
||||
* Add a <code>WHERE</code> clause to the query.
|
||||
* Add a <code>WHERE</code> clause to the <code>INSERT</code> statement's
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause.
|
||||
* <p>
|
||||
* <b>NOTE</b>: When inserting plain SQL into jOOQ objects, you must
|
||||
* guarantee syntax integrity. You may also create the possibility of
|
||||
@ -175,13 +182,15 @@ public interface InsertOnConflictWhereStep<R extends Record> extends InsertRetur
|
||||
InsertOnConflictConditionStep<R> where(String sql, QueryPart... parts);
|
||||
|
||||
/**
|
||||
* Add a <code>WHERE EXISTS</code> clause to the query.
|
||||
* Add a <code>WHERE EXISTS</code> clause to the <code>INSERT</code> statement's
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause.
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, POSTGRES_9_5 })
|
||||
InsertOnConflictConditionStep<R> whereExists(Select<?> select);
|
||||
|
||||
/**
|
||||
* Add a <code>WHERE NOT EXISTS</code> clause to the query.
|
||||
* Add a <code>WHERE NOT EXISTS</code> clause to the <code>INSERT</code> statement's
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause.
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, POSTGRES_9_5 })
|
||||
InsertOnConflictConditionStep<R> whereNotExists(Select<?> select);
|
||||
|
||||
@ -93,28 +93,28 @@ public interface InsertOnDuplicateSetStep<R extends Record> {
|
||||
|
||||
/**
|
||||
* Set values for <code>UPDATE</code> in the <code>INSERT</code> statement's
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> clause.
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause.
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 })
|
||||
<T> InsertOnDuplicateSetMoreStep<R> set(Field<T> field, T value);
|
||||
|
||||
/**
|
||||
* Set values for <code>UPDATE</code> in the <code>INSERT</code> statement's
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> clause.
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause.
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 })
|
||||
<T> InsertOnDuplicateSetMoreStep<R> set(Field<T> field, Field<T> value);
|
||||
|
||||
/**
|
||||
* Set values for <code>UPDATE</code> in the <code>INSERT</code> statement's
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> clause.
|
||||
* <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause.
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 })
|
||||
<T> InsertOnDuplicateSetMoreStep<R> set(Field<T> field, Select<? extends Record1<T>> value);
|
||||
|
||||
/**
|
||||
* Set multiple values for <code>UPDATE</code> in the <code>INSERT</code>
|
||||
* statement's <code>ON DUPLICATE KEY UPDATE</code> clause.
|
||||
* statement's <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause.
|
||||
* <p>
|
||||
* Keys can either be of type {@link String}, {@link Name}, or
|
||||
* {@link Field}.
|
||||
@ -128,7 +128,7 @@ public interface InsertOnDuplicateSetStep<R extends Record> {
|
||||
|
||||
/**
|
||||
* Set multiple values for <code>UPDATE</code> in the <code>INSERT</code>
|
||||
* statement's <code>ON DUPLICATE KEY UPDATE</code> clause.
|
||||
* statement's <code>ON DUPLICATE KEY UPDATE</code> or <code>ON CONFLICT ... DO UPDATE</code> clause.
|
||||
* <p>
|
||||
* This is the same as calling {@link #set(Map)} with the argument record
|
||||
* treated as a <code>Map<Field<?>, Object></code>.
|
||||
|
||||
@ -93,25 +93,25 @@ import java.util.Collection;
|
||||
public interface InsertOnDuplicateStep<R extends Record> extends InsertReturningStep<R> {
|
||||
|
||||
/**
|
||||
* Add a <code>ON CONFLICT ON CONSTRAINT</code> clause to this query.
|
||||
* Add a <code>ON CONFLICT ON CONSTRAINT</code> clause to this INSERT statement.
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, FIREBIRD_3_0, HSQLDB, POSTGRES_9_5 })
|
||||
InsertOnConflictDoUpdateStep<R> onConflictOnConstraint(Constraint constraint);
|
||||
|
||||
/**
|
||||
* Add a <code>ON CONFLICT ON CONSTRAINT</code> clause to this query.
|
||||
* Add a <code>ON CONFLICT ON CONSTRAINT</code> clause to this INSERT statement.
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, FIREBIRD_3_0, HSQLDB, POSTGRES_9_5 })
|
||||
InsertOnConflictDoUpdateStep<R> onConflictOnConstraint(Name constraint);
|
||||
|
||||
/**
|
||||
* Add a <code>ON CONFLICT ON CONSTRAINT</code> clause to this query.
|
||||
* Add a <code>ON CONFLICT ON CONSTRAINT</code> clause to this INSERT statement.
|
||||
*/
|
||||
@Support
|
||||
InsertOnConflictDoUpdateStep<R> onConflictOnConstraint(UniqueKey<R> constraint);
|
||||
|
||||
/**
|
||||
* Add an <code>ON CONFLICT</code> clause to this insert query.
|
||||
* Add an <code>ON CONFLICT</code> clause to this INSERT statement.
|
||||
* <p>
|
||||
* Only {@link SQLDialect#POSTGRES} has native support for this clause. The
|
||||
* other dialects can emulate it using <code>MERGE</code>, if table meta
|
||||
@ -121,7 +121,7 @@ public interface InsertOnDuplicateStep<R extends Record> extends InsertReturning
|
||||
InsertOnConflictDoUpdateStep<R> onConflict(Field<?>... keys);
|
||||
|
||||
/**
|
||||
* Add an <code>ON CONFLICT</code> clause to this insert query.
|
||||
* Add an <code>ON CONFLICT</code> clause to this INSERT statement.
|
||||
* <p>
|
||||
* Only {@link SQLDialect#POSTGRES} has native support for this clause. The
|
||||
* other dialects can emulate it using <code>MERGE</code>, if table meta
|
||||
@ -131,7 +131,7 @@ public interface InsertOnDuplicateStep<R extends Record> extends InsertReturning
|
||||
InsertOnConflictDoUpdateStep<R> onConflict(Collection<? extends Field<?>> keys);
|
||||
|
||||
/**
|
||||
* Add an <code>ON CONFLICT DO NOTHING</code> clause to this insert query.
|
||||
* Add an <code>ON CONFLICT DO NOTHING</code> clause to this INSERT statement.
|
||||
* <p>
|
||||
* Only {@link SQLDialect#POSTGRES} has native support for this clause. The
|
||||
* other dialects can emulate it using <code>MERGE</code>, if table meta
|
||||
@ -141,7 +141,7 @@ public interface InsertOnDuplicateStep<R extends Record> extends InsertReturning
|
||||
InsertReturningStep<R> onConflictDoNothing();
|
||||
|
||||
/**
|
||||
* Add an <code>ON DUPLICATE KEY UPDATE</code> clause to this insert query.
|
||||
* Add an <code>ON DUPLICATE KEY UPDATE</code> clause to this INSERT statement.
|
||||
* <p>
|
||||
* This will try to <code>INSERT</code> a record. If there is a primary key
|
||||
* or unique key in this <code>INSERT</code> statement's affected table that
|
||||
@ -164,7 +164,7 @@ public interface InsertOnDuplicateStep<R extends Record> extends InsertReturning
|
||||
InsertOnDuplicateSetStep<R> onDuplicateKeyUpdate();
|
||||
|
||||
/**
|
||||
* Add an <code>ON DUPLICATE KEY IGNORE</code> clause to this insert query.
|
||||
* Add an <code>ON DUPLICATE KEY IGNORE</code> clause to this INSERT statement.
|
||||
* <p>
|
||||
* This will try to <code>INSERT</code> a record. If there is a primary key
|
||||
* or unique key in this <code>INSERT</code> statement's affected table that
|
||||
|
||||
Loading…
Reference in New Issue
Block a user