Skip to content

Commit

Permalink
[#7616] Support CREATE OR REPLACE VIEW in H2
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaseder committed Jun 26, 2018
1 parent 8ae7218 commit dc59407
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions jOOQ/src/main/java/org/jooq/impl/CreateViewImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
// ...
import static org.jooq.SQLDialect.DERBY;
import static org.jooq.SQLDialect.FIREBIRD;
import static org.jooq.SQLDialect.H2;
// ...
// ...
import static org.jooq.SQLDialect.POSTGRES;
Expand Down Expand Up @@ -98,7 +97,6 @@ final class CreateViewImpl<R extends Record> extends AbstractQuery implements
private static final long serialVersionUID = 8904572826501186329L;
private static final Clause[] CLAUSES = { CREATE_VIEW };
private static final EnumSet<SQLDialect> NO_SUPPORT_IF_NOT_EXISTS = EnumSet.of(DERBY, FIREBIRD, POSTGRES);
private static final EnumSet<SQLDialect> NO_SUPPORT_OR_REPLACE = EnumSet.of(H2);

private final boolean ifNotExists;
private final boolean orReplace;
Expand Down Expand Up @@ -186,7 +184,7 @@ private final void accept0(Context<?> ctx) {
ctx.start(CREATE_VIEW_NAME)
.visit(replaceSupported && orReplace ? K_REPLACE : K_CREATE);

if (orReplace && !replaceSupported && !NO_SUPPORT_OR_REPLACE.contains(ctx.family())) {
if (orReplace && !replaceSupported) {
ctx.sql(' ').visit(K_OR);

switch (ctx.family()) {
Expand Down

0 comments on commit dc59407

Please sign in to comment.