diff --git a/jOOQ/src/main/java/org/jooq/Table.java b/jOOQ/src/main/java/org/jooq/Table.java index 0a52f7b7d8..79a25fa51f 100644 --- a/jOOQ/src/main/java/org/jooq/Table.java +++ b/jOOQ/src/main/java/org/jooq/Table.java @@ -73,6 +73,7 @@ import java.util.List; import java.util.function.BiFunction; import java.util.function.Function; +import org.jooq.TableOptions.TableType; import org.jooq.conf.Settings; import org.jooq.impl.DSL; diff --git a/jOOQ/src/main/java/org/jooq/TableOptions.java b/jOOQ/src/main/java/org/jooq/TableOptions.java index 6a097830c1..e77ecc66ea 100644 --- a/jOOQ/src/main/java/org/jooq/TableOptions.java +++ b/jOOQ/src/main/java/org/jooq/TableOptions.java @@ -152,6 +152,53 @@ public final class TableOptions implements Serializable { return select; } + /** + * A description of the type of a {@link Table}. + */ + public enum TableType { + + /** + * An ordinary table that is stored in the schema. + */ + TABLE, + + /** + * A global temporary table that is stored in the schema and visible to + * everyone. + */ + TEMPORARY, + + /** + * A view that is defined by a {@link Select} statement. + */ + VIEW, + + /** + * A materialised view that is defined by a {@link Select} statement, and + * whose data is materialised in the schema. + */ + MATERIALIZED_VIEW, + + /** + * A table valued function that is defined by a {@link Routine}. + */ + FUNCTION, + + /** + * A table expression, such as a derived table, a joined table, a common + * table expression, etc. + */ + EXPRESSION, + + /** + * A table type that is unknown to jOOQ. + */ + UNKNOWN + } + + /** + * The ON COMMIT flag for {@link TableType#TEMPORARY} tables. + */ public enum OnCommit { @Support({ POSTGRES }) diff --git a/jOOQ/src/main/java/org/jooq/TableType.java b/jOOQ/src/main/java/org/jooq/TableType.java deleted file mode 100644 index a0f5c9165d..0000000000 --- a/jOOQ/src/main/java/org/jooq/TableType.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Other licenses: - * ----------------------------------------------------------------------------- - * Commercial licenses for this work are available. These replace the above - * ASL 2.0 and offer limited warranties, support, maintenance, and commercial - * database integrations. - * - * For more information, please visit: http://www.jooq.org/licenses - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - */ -package org.jooq; - -/** - * A description of the type of a {@link Table}. - * - * @author Lukas Eder - */ -public enum TableType { - - /** - * An ordinary table that is stored in the schema. - */ - TABLE, - - /** - * A global temporary table that is stored in the schema and visible to - * everyone. - */ - TEMPORARY, - - /** - * A view that is defined by a {@link Select} statement. - */ - VIEW, - - /** - * A materialised view that is defined by a {@link Select} statement, and - * whose data is materialised in the schema. - */ - MATERIALIZED_VIEW, - - /** - * A table valued function that is defined by a {@link Routine}. - */ - FUNCTION, - - /** - * A table expression, such as a derived table, a joined table, a common - * table expression, etc. - */ - EXPRESSION, - - /** - * A table type that is unknown to jOOQ. - */ - UNKNOWN -} diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractTable.java b/jOOQ/src/main/java/org/jooq/impl/AbstractTable.java index 07d7115c8f..cf30508d9d 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractTable.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractTable.java @@ -106,7 +106,7 @@ import org.jooq.TableOptionalOnStep; import org.jooq.TableOptions; import org.jooq.TableOuterJoinStep; import org.jooq.TablePartitionByStep; -import org.jooq.TableType; +import org.jooq.TableOptions.TableType; import org.jooq.UniqueKey; // ... // ... diff --git a/jOOQ/src/main/java/org/jooq/impl/DDL.java b/jOOQ/src/main/java/org/jooq/impl/DDL.java index bbd3c426b5..6e8a5c35b6 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DDL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DDL.java @@ -70,7 +70,7 @@ import org.jooq.Schema; import org.jooq.Sequence; import org.jooq.Table; import org.jooq.TableOptions.OnCommit; -import org.jooq.TableType; +import org.jooq.TableOptions.TableType; import org.jooq.UniqueKey; import org.jooq.tools.StringUtils; diff --git a/jOOQ/src/main/java/org/jooq/impl/DDLInterpreter.java b/jOOQ/src/main/java/org/jooq/impl/DDLInterpreter.java index 0125954d98..b0d57a5fe7 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DDLInterpreter.java +++ b/jOOQ/src/main/java/org/jooq/impl/DDLInterpreter.java @@ -76,7 +76,7 @@ import org.jooq.SortOrder; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; -import org.jooq.TableType; +import org.jooq.TableOptions.TableType; import org.jooq.UniqueKey; import org.jooq.exception.DataAccessException; import org.jooq.exception.DataDefinitionException;