[jOOQ/jOOQ#7291] Fixed Firebird support

This commit is contained in:
Lukas Eder 2020-04-08 17:14:50 +02:00
parent da0cbb7706
commit a465035339
4 changed files with 11 additions and 11 deletions

View File

@ -39,6 +39,7 @@ package org.jooq;
// ...
import static org.jooq.SQLDialect.DERBY;
import static org.jooq.SQLDialect.FIREBIRD;
import static org.jooq.SQLDialect.H2;
import static org.jooq.SQLDialect.HSQLDB;
// ...
@ -96,7 +97,7 @@ public interface MergeMatchedDeleteStep<R extends Record> extends MergeMatchedSt
* >http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_9016.
* htm</a> for a full definition of the Oracle <code>MERGE</code> statement
*/
@Support({ DERBY, H2, HSQLDB })
@Support({ DERBY, FIREBIRD, H2, HSQLDB })
MergeNotMatchedStep<R> deleteWhere(Condition condition);
/**
@ -108,7 +109,7 @@ public interface MergeMatchedDeleteStep<R extends Record> extends MergeMatchedSt
* >http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_9016.
* htm</a> for a full definition of the Oracle <code>MERGE</code> statement
*/
@Support({ DERBY, H2, HSQLDB })
@Support({ DERBY, FIREBIRD, H2, HSQLDB })
MergeNotMatchedStep<R> deleteWhere(Field<Boolean> condition);
/**
@ -130,6 +131,6 @@ public interface MergeMatchedDeleteStep<R extends Record> extends MergeMatchedSt
* method will be removed in the future.
*/
@Deprecated
@Support({ DERBY, H2, HSQLDB })
@Support({ DERBY, FIREBIRD, H2, HSQLDB })
MergeNotMatchedStep<R> deleteWhere(Boolean condition);
}

View File

@ -101,7 +101,7 @@ public interface MergeMatchedStep<R extends Record> extends MergeNotMatchedStep<
* Add the <code>WHEN MATCHED THEN DELETE</code> clause to the
* <code>MERGE</code> statement.
*/
@Support({ DERBY, H2, HSQLDB })
@Support({ DERBY, FIREBIRD, H2, HSQLDB })
MergeMatchedStep<R> whenMatchedThenDelete();
/**

View File

@ -98,6 +98,6 @@ public interface MergeMatchedThenStep<R extends Record> {
* Add the <code>THEN UPDATE</code> clause to the
* <code>MERGE</code> statement.
*/
@Support({ DERBY, H2, HSQLDB })
@Support({ DERBY, FIREBIRD, H2, HSQLDB })
MergeMatchedStep<R> thenDelete();
}

View File

@ -47,7 +47,6 @@ import static org.jooq.Clause.MERGE_USING;
import static org.jooq.Clause.MERGE_VALUES;
import static org.jooq.Clause.MERGE_WHEN_MATCHED_THEN_UPDATE;
import static org.jooq.Clause.MERGE_WHEN_NOT_MATCHED_THEN_INSERT;
import static org.jooq.SQLDialect.FIREBIRD;
import static org.jooq.SQLDialect.H2;
import static org.jooq.SQLDialect.HSQLDB;
// ...
@ -246,8 +245,8 @@ implements
*/
private static final long serialVersionUID = -8835479296876774391L;
private static final Clause[] CLAUSES = { MERGE };
private static final Set<SQLDialect> NO_SUPPORT_AND = SQLDialect.supportedBy(FIREBIRD);
private static final Set<SQLDialect> NO_SUPPORT_MULTI = SQLDialect.supportedBy(FIREBIRD, HSQLDB);
private static final Set<SQLDialect> NO_SUPPORT_AND = SQLDialect.supportedBy();
private static final Set<SQLDialect> NO_SUPPORT_MULTI = SQLDialect.supportedBy(HSQLDB);
private static final Set<SQLDialect> REQUIRE_NEGATION = SQLDialect.supportedBy(H2);
private final WithImpl with;
@ -1179,7 +1178,7 @@ implements
@Override
public final MergeImpl whenNotMatchedThenInsert(Collection<? extends Field<?>> fields) {
notMatchedClause = true;
notMatched.add(new NotMatchedClause(null));
notMatched.add(new NotMatchedClause(noCondition()));
getLastNotMatched().insertMap.addFields(fields);
matchedClause = false;
@ -1692,7 +1691,7 @@ implements
.visit(K_NOT).sql(' ')
.visit(K_MATCHED).sql(' ');
if (m.condition != null && !(m.condition instanceof NoCondition) && !NO_SUPPORT_AND.contains(ctx.dialect()))
if (!(m.condition instanceof NoCondition) && !NO_SUPPORT_AND.contains(ctx.dialect()))
ctx.visit(K_AND).sql(' ').visit(m.condition).sql(' ');
ctx.visit(K_THEN).sql(' ')
@ -1794,7 +1793,7 @@ implements
NotMatchedClause(Condition condition) {
this.insertMap = new FieldMapsForInsert(table);
this.condition = condition;
this.condition = condition == null ? noCondition() : condition;
}
}
}