diff --git a/jOOQ/src/main/java/org/jooq/DSLContext.java b/jOOQ/src/main/java/org/jooq/DSLContext.java index 616c661a7a..4bf71b2d90 100644 --- a/jOOQ/src/main/java/org/jooq/DSLContext.java +++ b/jOOQ/src/main/java/org/jooq/DSLContext.java @@ -9127,73 +9127,6 @@ public interface DSLContext extends Scope { @NotNull Queries ddl(Collection> tables, DDLExportConfiguration configuration); - // ------------------------------------------------------------------------- - // XXX Session Statements - // ------------------------------------------------------------------------- - - /** - * Set the current catalog to a new value. - * - * @see DSL#catalog(Name) - */ - @NotNull - @Support({ MARIADB, MYSQL }) - RowCountQuery setCatalog(String catalog); - - /** - * Set the current catalog to a new value. - * - * @see DSL#catalog(Name) - */ - @NotNull - @Support({ MARIADB, MYSQL }) - RowCountQuery setCatalog(Name catalog); - - /** - * Set the current catalog to a new value. - */ - @NotNull - @Support({ MARIADB, MYSQL }) - RowCountQuery setCatalog(Catalog catalog); - - /** - * Set the current schema to a new value. - * - * @see DSL#schema(Name) - * @see DSL#setSchema(String) - */ - @NotNull - @Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) - RowCountQuery setSchema(String schema); - - /** - * Set the current schema to a new value. - * - * @see DSL#schema(Name) - * @see DSL#setSchema(Name) - */ - @NotNull - @Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) - RowCountQuery setSchema(Name schema); - - /** - * Set the current schema to a new value. - * - * @see DSL#setSchema(Schema) - */ - @NotNull - @Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) - RowCountQuery setSchema(Schema schema); - - /** - * Set a vendor specific flag to a new value. - * - * @see DSL#set(Name, Param) - */ - @NotNull - @Support({ MYSQL }) - RowCountQuery set(Name name, Param param); - // ------------------------------------------------------------------------- // XXX DDL Statements // ------------------------------------------------------------------------- @@ -9875,6 +9808,83 @@ public interface DSLContext extends Scope { @Support({ HSQLDB, POSTGRES }) RevokeOnStep revokeGrantOptionFor(Collection privileges); + /** + * The SET statement. + *

+ * Set a vendor specific flag to a new value. + * + * @see DSL#set(Name,Param) + */ + @NotNull + @Support({ MYSQL }) + RowCountQuery set(Name name, Param value); + + /** + * The SET CATALOG statement. + *

+ * Set the current catalog to a new value. + * + * @see DSL#setCatalog(String) + */ + @NotNull + @Support({ MARIADB, MYSQL }) + RowCountQuery setCatalog(String catalog); + + /** + * The SET CATALOG statement. + *

+ * Set the current catalog to a new value. + * + * @see DSL#setCatalog(Name) + */ + @NotNull + @Support({ MARIADB, MYSQL }) + RowCountQuery setCatalog(Name catalog); + + /** + * The SET CATALOG statement. + *

+ * Set the current catalog to a new value. + * + * @see DSL#setCatalog(Catalog) + */ + @NotNull + @Support({ MARIADB, MYSQL }) + RowCountQuery setCatalog(Catalog catalog); + + /** + * The SET SCHEMA statement. + *

+ * Set the current schema to a new value. + * + * @see DSL#setSchema(String) + */ + @NotNull + @Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) + RowCountQuery setSchema(String schema); + + /** + * The SET SCHEMA statement. + *

+ * Set the current schema to a new value. + * + * @see DSL#setSchema(Name) + */ + @NotNull + @Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) + RowCountQuery setSchema(Name schema); + + /** + * The SET SCHEMA statement. + *

+ * Set the current schema to a new value. + * + * @see DSL#setSchema(Schema) + */ + @NotNull + @Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) + RowCountQuery setSchema(Schema schema); + /** diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java index 33f6d57273..cf54d4f799 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DSL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java @@ -7065,87 +7065,6 @@ public class DSL { return constraint().check(condition); } - // ------------------------------------------------------------------------- - // XXX Session Statements - // ------------------------------------------------------------------------- - - /** - * Set the current catalog to a new value. - * - * @see DSL#catalog(Name) - */ - @NotNull - @Support({ MARIADB, MYSQL }) - public static RowCountQuery setCatalog(String catalog) { - return dsl().setCatalog(catalog); - } - - /** - * Set the current catalog to a new value. - * - * @see DSL#catalog(Name) - */ - @NotNull - @Support({ MARIADB, MYSQL }) - public static RowCountQuery setCatalog(Name catalog) { - return dsl().setCatalog(catalog); - } - - /** - * Set the current catalog to a new value. - */ - @NotNull - @Support({ MARIADB, MYSQL }) - public static RowCountQuery setCatalog(Catalog catalog) { - return dsl().setCatalog(catalog); - } - - /** - * Set the current schema to a new value. - * - * @see DSL#schema(Name) - * @see DSLContext#setSchema(String) - */ - @NotNull - @Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) - public static RowCountQuery setSchema(String schema) { - return dsl().setSchema(schema); - } - - /** - * Set the current schema to a new value. - * - * @see DSL#schema(Name) - * @see DSLContext#setSchema(Name) - */ - @NotNull - @Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) - public static RowCountQuery setSchema(Name schema) { - return dsl().setSchema(schema); - } - - /** - * Set the current schema to a new value. - * - * @see DSLContext#setSchema(Schema) - */ - @NotNull - @Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) - public static RowCountQuery setSchema(Schema schema) { - return dsl().setSchema(schema); - } - - /** - * Set a vendor specific flag to a new value. - * - * @see DSLContext#set(Name, Param) - */ - @NotNull - @Support({ MYSQL }) - public static RowCountQuery set(Name name, Param param) { - return dsl().set(name, param); - } - // ------------------------------------------------------------------------- // XXX DDL Statements // ------------------------------------------------------------------------- @@ -7977,6 +7896,97 @@ public class DSL { return dsl().revokeGrantOptionFor(privileges); } + /** + * The SET statement. + *

+ * Set a vendor specific flag to a new value. + * + * @see DSLContext#set(Name,Param) + */ + @NotNull + @Support({ MYSQL }) + public static org.jooq.RowCountQuery set(Name name, Param value) { + return dsl().set(name, value); + } + + /** + * The SET CATALOG statement. + *

+ * Set the current catalog to a new value. + * + * @see DSLContext#setCatalog(String) + */ + @NotNull + @Support({ MARIADB, MYSQL }) + public static org.jooq.RowCountQuery setCatalog(String catalog) { + return dsl().setCatalog(catalog); + } + + /** + * The SET CATALOG statement. + *

+ * Set the current catalog to a new value. + * + * @see DSLContext#setCatalog(Name) + */ + @NotNull + @Support({ MARIADB, MYSQL }) + public static org.jooq.RowCountQuery setCatalog(Name catalog) { + return dsl().setCatalog(catalog); + } + + /** + * The SET CATALOG statement. + *

+ * Set the current catalog to a new value. + * + * @see DSLContext#setCatalog(Catalog) + */ + @NotNull + @Support({ MARIADB, MYSQL }) + public static org.jooq.RowCountQuery setCatalog(Catalog catalog) { + return dsl().setCatalog(catalog); + } + + /** + * The SET SCHEMA statement. + *

+ * Set the current schema to a new value. + * + * @see DSLContext#setSchema(String) + */ + @NotNull + @Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) + public static org.jooq.RowCountQuery setSchema(String schema) { + return dsl().setSchema(schema); + } + + /** + * The SET SCHEMA statement. + *

+ * Set the current schema to a new value. + * + * @see DSLContext#setSchema(Name) + */ + @NotNull + @Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) + public static org.jooq.RowCountQuery setSchema(Name schema) { + return dsl().setSchema(schema); + } + + /** + * The SET SCHEMA statement. + *

+ * Set the current schema to a new value. + * + * @see DSLContext#setSchema(Schema) + */ + @NotNull + @Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) + public static org.jooq.RowCountQuery setSchema(Schema schema) { + return dsl().setSchema(schema); + } + /** diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java b/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java index 6304e9be18..f265b3a1a7 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java +++ b/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java @@ -3337,6 +3337,41 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri return new RevokeImpl(configuration(), privileges, true); } + @Override + public org.jooq.RowCountQuery set(Name name, Param value) { + return new SetCommand(configuration(), name, value); + } + + @Override + public org.jooq.RowCountQuery setCatalog(String catalog) { + return new SetCatalog(configuration(), DSL.catalog(DSL.name(catalog))); + } + + @Override + public org.jooq.RowCountQuery setCatalog(Name catalog) { + return new SetCatalog(configuration(), DSL.catalog(catalog)); + } + + @Override + public org.jooq.RowCountQuery setCatalog(Catalog catalog) { + return new SetCatalog(configuration(), catalog); + } + + @Override + public org.jooq.RowCountQuery setSchema(String schema) { + return new SetSchema(configuration(), DSL.schema(DSL.name(schema))); + } + + @Override + public org.jooq.RowCountQuery setSchema(Name schema) { + return new SetSchema(configuration(), DSL.schema(schema)); + } + + @Override + public org.jooq.RowCountQuery setSchema(Schema schema) { + return new SetSchema(configuration(), schema); + } + @Override @@ -3418,41 +3453,6 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri // XXX DDL Statements // ------------------------------------------------------------------------- - @Override - public RowCountQuery setCatalog(String catalog) { - return setCatalog(name(catalog)); - } - - @Override - public RowCountQuery setCatalog(Name catalog) { - return setCatalog(catalog(catalog)); - } - - @Override - public RowCountQuery setCatalog(Catalog catalog) { - return new SetCatalog(configuration(), catalog); - } - - @Override - public RowCountQuery setSchema(String schema) { - return setSchema(name(schema)); - } - - @Override - public RowCountQuery setSchema(Name schema) { - return setSchema(schema(schema)); - } - - @Override - public RowCountQuery setSchema(Schema schema) { - return new SetSchema(configuration(), schema); - } - - @Override - public RowCountQuery set(Name name, Param param) { - return new SetCommand(configuration(), name, param); - } - @Override public CommentOnIsStep commentOnTable(String tableName) { return commentOnTable(name(tableName)); diff --git a/jOOQ/src/main/java/org/jooq/impl/SetCatalog.java b/jOOQ/src/main/java/org/jooq/impl/SetCatalog.java index abc9c23599..abefb020a9 100644 --- a/jOOQ/src/main/java/org/jooq/impl/SetCatalog.java +++ b/jOOQ/src/main/java/org/jooq/impl/SetCatalog.java @@ -37,28 +37,51 @@ */ package org.jooq.impl; -import static org.jooq.impl.Keywords.K_CATALOG; -import static org.jooq.impl.Keywords.K_SET; -import static org.jooq.impl.Keywords.K_USE; +import static org.jooq.impl.DSL.*; +import static org.jooq.impl.Internal.*; +import static org.jooq.impl.Keywords.*; +import static org.jooq.impl.Names.*; +import static org.jooq.impl.SQLDataType.*; +import static org.jooq.impl.Tools.*; +import static org.jooq.impl.Tools.BooleanDataKey.*; +import static org.jooq.SQLDialect.*; + +import org.jooq.*; +import org.jooq.impl.*; + +import java.util.*; -import org.jooq.Catalog; -import org.jooq.Configuration; -import org.jooq.Context; /** - * @author Lukas Eder + * The SET CATALOG statement. */ -final class SetCatalog extends AbstractRowCountQuery { +@SuppressWarnings({ "unused" }) +final class SetCatalog +extends + AbstractRowCountQuery +{ - private static final long serialVersionUID = -3996953205762741746L; - private final Catalog catalog; + private static final long serialVersionUID = 1L; - SetCatalog(Configuration configuration, Catalog catalog) { + private final Catalog catalog; + + SetCatalog( + Configuration configuration, + Catalog catalog + ) { super(configuration); this.catalog = catalog; } + final Catalog $catalog() { return catalog; } + + // ------------------------------------------------------------------------- + // XXX: QueryPart API + // ------------------------------------------------------------------------- + + + @Override public final void accept(Context ctx) { switch (ctx.family()) { @@ -90,4 +113,6 @@ final class SetCatalog extends AbstractRowCountQuery { break; } } + + } diff --git a/jOOQ/src/main/java/org/jooq/impl/SetCommand.java b/jOOQ/src/main/java/org/jooq/impl/SetCommand.java index 37830b5e02..156b5e917f 100644 --- a/jOOQ/src/main/java/org/jooq/impl/SetCommand.java +++ b/jOOQ/src/main/java/org/jooq/impl/SetCommand.java @@ -37,29 +37,40 @@ */ package org.jooq.impl; -import static org.jooq.impl.Keywords.K_SET; +import static org.jooq.impl.DSL.*; +import static org.jooq.impl.Internal.*; +import static org.jooq.impl.Keywords.*; +import static org.jooq.impl.Names.*; +import static org.jooq.impl.SQLDataType.*; +import static org.jooq.impl.Tools.*; +import static org.jooq.impl.Tools.BooleanDataKey.*; +import static org.jooq.SQLDialect.*; + +import org.jooq.*; +import org.jooq.impl.*; + +import java.util.*; -import org.jooq.Configuration; -import org.jooq.Context; -import org.jooq.Name; -import org.jooq.Param; /** - * A SET command. - * - * @author Lukas Eder + * The SET statement. */ -final class SetCommand extends AbstractRowCountQuery { +@SuppressWarnings({ "rawtypes", "unused" }) +final class SetCommand +extends + AbstractRowCountQuery +{ - /** - * Generated UID - */ - private static final long serialVersionUID = -6018875346107141474L; + private static final long serialVersionUID = 1L; - private final Name name; - private final Param value; + private final Name name; + private final Param value; - SetCommand(Configuration configuration, Name name, Param value) { + SetCommand( + Configuration configuration, + Name name, + Param value + ) { super(configuration); this.name = name; @@ -69,12 +80,16 @@ final class SetCommand extends AbstractRowCountQuery { final Name $name() { return name; } final Param $value() { return value; } - // ------------------------------------------------------------------------ + // ------------------------------------------------------------------------- // XXX: QueryPart API - // ------------------------------------------------------------------------ + // ------------------------------------------------------------------------- + + @Override public final void accept(Context ctx) { ctx.visit(K_SET).sql(' ').visit(name).sql(" = ").visit(value); } + + } diff --git a/jOOQ/src/main/java/org/jooq/impl/SetSchema.java b/jOOQ/src/main/java/org/jooq/impl/SetSchema.java index 0fa371dfd4..872d7727c1 100644 --- a/jOOQ/src/main/java/org/jooq/impl/SetSchema.java +++ b/jOOQ/src/main/java/org/jooq/impl/SetSchema.java @@ -37,28 +37,38 @@ */ package org.jooq.impl; -import static org.jooq.impl.Keywords.K_ALTER; -import static org.jooq.impl.Keywords.K_CURRENT_SCHEMA; -import static org.jooq.impl.Keywords.K_DATABASE; -import static org.jooq.impl.Keywords.K_SCHEMA; -import static org.jooq.impl.Keywords.K_SEARCH_PATH; -import static org.jooq.impl.Keywords.K_SESSION; -import static org.jooq.impl.Keywords.K_SET; -import static org.jooq.impl.Keywords.K_USE; +import static org.jooq.impl.DSL.*; +import static org.jooq.impl.Internal.*; +import static org.jooq.impl.Keywords.*; +import static org.jooq.impl.Names.*; +import static org.jooq.impl.SQLDataType.*; +import static org.jooq.impl.Tools.*; +import static org.jooq.impl.Tools.BooleanDataKey.*; +import static org.jooq.SQLDialect.*; + +import org.jooq.*; +import org.jooq.impl.*; + +import java.util.*; -import org.jooq.Configuration; -import org.jooq.Context; -import org.jooq.Schema; /** - * @author Lukas Eder + * The SET SCHEMA statement. */ -final class SetSchema extends AbstractRowCountQuery { +@SuppressWarnings({ "unused" }) +final class SetSchema +extends + AbstractRowCountQuery +{ - private static final long serialVersionUID = -3996953205762741746L; - private final Schema schema; + private static final long serialVersionUID = 1L; - SetSchema(Configuration configuration, Schema schema) { + private final Schema schema; + + SetSchema( + Configuration configuration, + Schema schema + ) { super(configuration); this.schema = schema; @@ -66,6 +76,12 @@ final class SetSchema extends AbstractRowCountQuery { final Schema $schema() { return schema; } + // ------------------------------------------------------------------------- + // XXX: QueryPart API + // ------------------------------------------------------------------------- + + + @Override public final void accept(Context ctx) { switch (ctx.family()) { @@ -104,4 +120,6 @@ final class SetSchema extends AbstractRowCountQuery { break; } } + + }