[#2123] Cannot combine INSERT .. RETURNING with INSERT .. ON DUPLICATE KEY .. due to DSL API flaw

This commit is contained in:
lukaseder 2017-04-17 18:34:27 +02:00
parent 34d16b48f4
commit 82ca21d509
3 changed files with 13 additions and 13 deletions

View File

@ -66,5 +66,5 @@ public interface InsertOnConflictDoUpdateStep<R extends Record> {
* Add the <code>DO IGNORE</code> clause.
*/
@Support({ POSTGRES_9_5 })
InsertFinalStep<R> doNothing();
InsertReturningStep<R> doNothing();
}

View File

@ -57,27 +57,27 @@ import org.jooq.impl.DSL;
*
* @author Lukas Eder
*/
public interface InsertOnConflictWhereStep<R extends Record> extends InsertFinalStep<R> {
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}.
*/
@Support({ POSTGRES_9_5 })
InsertFinalStep<R> where(Condition... conditions);
InsertReturningStep<R> where(Condition... conditions);
/**
* Add a <code>WHERE</code> clause to the query, connecting them with each
* other with {@link Operator#AND}.
*/
@Support({ POSTGRES_9_5 })
InsertFinalStep<R> where(Collection<? extends Condition> conditions);
InsertReturningStep<R> where(Collection<? extends Condition> conditions);
/**
* Add a <code>WHERE</code> clause to the query.
*/
@Support({ POSTGRES_9_5 })
InsertFinalStep<R> where(Field<Boolean> field);
InsertReturningStep<R> where(Field<Boolean> field);
/**
* Add a <code>WHERE</code> clause to the query.
@ -92,7 +92,7 @@ public interface InsertOnConflictWhereStep<R extends Record> extends InsertFinal
*/
@Support({ POSTGRES_9_5 })
@PlainSQL
InsertFinalStep<R> where(SQL sql);
InsertReturningStep<R> where(SQL sql);
/**
* Add a <code>WHERE</code> clause to the query.
@ -107,7 +107,7 @@ public interface InsertOnConflictWhereStep<R extends Record> extends InsertFinal
*/
@Support({ POSTGRES_9_5 })
@PlainSQL
InsertFinalStep<R> where(String sql);
InsertReturningStep<R> where(String sql);
/**
* Add a <code>WHERE</code> clause to the query.
@ -123,7 +123,7 @@ public interface InsertOnConflictWhereStep<R extends Record> extends InsertFinal
*/
@Support({ POSTGRES_9_5 })
@PlainSQL
InsertFinalStep<R> where(String sql, Object... bindings);
InsertReturningStep<R> where(String sql, Object... bindings);
/**
* Add a <code>WHERE</code> clause to the query.
@ -139,17 +139,17 @@ public interface InsertOnConflictWhereStep<R extends Record> extends InsertFinal
*/
@Support({ POSTGRES_9_5 })
@PlainSQL
InsertFinalStep<R> where(String sql, QueryPart... parts);
InsertReturningStep<R> where(String sql, QueryPart... parts);
/**
* Add a <code>WHERE EXISTS</code> clause to the query.
*/
@Support({ POSTGRES_9_5 })
InsertFinalStep<R> whereExists(Select<?> select);
InsertReturningStep<R> whereExists(Select<?> select);
/**
* Add a <code>WHERE NOT EXISTS</code> clause to the query.
*/
@Support({ POSTGRES_9_5 })
InsertFinalStep<R> whereNotExists(Select<?> select);
InsertReturningStep<R> whereNotExists(Select<?> select);
}

View File

@ -82,7 +82,7 @@ public interface InsertOnDuplicateStep<R extends Record> extends InsertReturning
* Add an <code>ON CONFLICT DO NOTHING</code> clause to this insert query.
*/
@Support({ POSTGRES_9_5 })
InsertFinalStep<R> onConflictDoNothing();
InsertReturningStep<R> onConflictDoNothing();
/**
* Add an <code>ON DUPLICATE KEY UPDATE</code> clause to this insert query.
@ -160,5 +160,5 @@ public interface InsertOnDuplicateStep<R extends Record> extends InsertReturning
* </table>
*/
@Support
InsertFinalStep<R> onDuplicateKeyIgnore();
InsertReturningStep<R> onDuplicateKeyIgnore();
}