Skip to content

Commit

Permalink
[#2123] Cannot combine INSERT .. RETURNING with INSERT .. ON DUPLICAT…
Browse files Browse the repository at this point in the history
…E KEY .. due to DSL API flaw
  • Loading branch information
lukaseder committed Apr 17, 2017
1 parent 34d16b4 commit 82ca21d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Expand Up @@ -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();
}
20 changes: 10 additions & 10 deletions jOOQ/src/main/java/org/jooq/InsertOnConflictWhereStep.java
Expand Up @@ -57,27 +57,27 @@
*
* @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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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);
}
4 changes: 2 additions & 2 deletions jOOQ/src/main/java/org/jooq/InsertOnDuplicateStep.java
Expand Up @@ -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.
Expand Down Expand Up @@ -160,5 +160,5 @@ public interface InsertOnDuplicateStep<R extends Record> extends InsertReturning
* </table>
*/
@Support
InsertFinalStep<R> onDuplicateKeyIgnore();
InsertReturningStep<R> onDuplicateKeyIgnore();
}

0 comments on commit 82ca21d

Please sign in to comment.