diff --git a/jOOQ/src/main/java/org/jooq/AlterDomainStep.java b/jOOQ/src/main/java/org/jooq/AlterDomainStep.java index de32912a79..5434812cb1 100644 --- a/jOOQ/src/main/java/org/jooq/AlterDomainStep.java +++ b/jOOQ/src/main/java/org/jooq/AlterDomainStep.java @@ -181,6 +181,8 @@ public interface AlterDomainStep { /** * Add the SET DEFAULT clause to the ALTER DOMAIN statement. + * + * @param setDefault is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ FIREBIRD, HSQLDB, POSTGRES }) @NotNull @CheckReturnValue diff --git a/jOOQ/src/main/java/org/jooq/AlterSequenceFlagsStep.java b/jOOQ/src/main/java/org/jooq/AlterSequenceFlagsStep.java index bc7c0f9de8..39d687285a 100644 --- a/jOOQ/src/main/java/org/jooq/AlterSequenceFlagsStep.java +++ b/jOOQ/src/main/java/org/jooq/AlterSequenceFlagsStep.java @@ -76,6 +76,8 @@ public interface AlterSequenceFlagsStep extends AlterSequenceF /** * Add the RESTART WITH clause to the ALTER SEQUENCE statement. + * + * @param restartWith is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES }) @NotNull @CheckReturnValue @@ -90,6 +92,8 @@ public interface AlterSequenceFlagsStep extends AlterSequenceF /** * Add the START WITH clause to the ALTER SEQUENCE statement. + * + * @param startWith is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ MARIADB, POSTGRES }) @NotNull @CheckReturnValue @@ -104,6 +108,8 @@ public interface AlterSequenceFlagsStep extends AlterSequenceF /** * Add the INCREMENT BY clause to the ALTER SEQUENCE statement. + * + * @param incrementBy is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES }) @NotNull @CheckReturnValue @@ -118,6 +124,8 @@ public interface AlterSequenceFlagsStep extends AlterSequenceF /** * Add the MINVALUE clause to the ALTER SEQUENCE statement. + * + * @param minvalue is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ CUBRID, H2, HSQLDB, MARIADB, POSTGRES }) @NotNull @CheckReturnValue @@ -139,6 +147,8 @@ public interface AlterSequenceFlagsStep extends AlterSequenceF /** * Add the MAXVALUE clause to the ALTER SEQUENCE statement. + * + * @param maxvalue is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ CUBRID, H2, HSQLDB, MARIADB, POSTGRES }) @NotNull @CheckReturnValue @@ -174,6 +184,8 @@ public interface AlterSequenceFlagsStep extends AlterSequenceF /** * Add the CACHE clause to the ALTER SEQUENCE statement. + * + * @param cache is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ CUBRID, H2, MARIADB, POSTGRES }) @NotNull @CheckReturnValue diff --git a/jOOQ/src/main/java/org/jooq/AlterTypeRenameValueToStep.java b/jOOQ/src/main/java/org/jooq/AlterTypeRenameValueToStep.java index 4f1bb11435..0d91dab5aa 100644 --- a/jOOQ/src/main/java/org/jooq/AlterTypeRenameValueToStep.java +++ b/jOOQ/src/main/java/org/jooq/AlterTypeRenameValueToStep.java @@ -69,6 +69,8 @@ public interface AlterTypeRenameValueToStep { /** * Add the TO clause to the ALTER TYPE statement. + * + * @param renameValueTo is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ POSTGRES }) @NotNull @CheckReturnValue diff --git a/jOOQ/src/main/java/org/jooq/AlterTypeStep.java b/jOOQ/src/main/java/org/jooq/AlterTypeStep.java index 842103506f..d357bec079 100644 --- a/jOOQ/src/main/java/org/jooq/AlterTypeStep.java +++ b/jOOQ/src/main/java/org/jooq/AlterTypeStep.java @@ -104,6 +104,8 @@ public interface AlterTypeStep { /** * Add the ADD VALUE clause to the ALTER TYPE statement. + * + * @param addValue is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ POSTGRES }) @NotNull @CheckReturnValue @@ -118,6 +120,8 @@ public interface AlterTypeStep { /** * Add the RENAME VALUE clause to the ALTER TYPE statement. + * + * @param renameValue is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ POSTGRES }) @NotNull @CheckReturnValue diff --git a/jOOQ/src/main/java/org/jooq/CreateDomainDefaultStep.java b/jOOQ/src/main/java/org/jooq/CreateDomainDefaultStep.java index 72b3fc3427..b95d61c81f 100644 --- a/jOOQ/src/main/java/org/jooq/CreateDomainDefaultStep.java +++ b/jOOQ/src/main/java/org/jooq/CreateDomainDefaultStep.java @@ -69,6 +69,8 @@ public interface CreateDomainDefaultStep extends CreateDomainConstraintStep { /** * Add the DEFAULT_ clause to the CREATE DOMAIN statement. + * + * @param default_ is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) @NotNull @CheckReturnValue diff --git a/jOOQ/src/main/java/org/jooq/CreateSequenceFlagsStep.java b/jOOQ/src/main/java/org/jooq/CreateSequenceFlagsStep.java index 22b5213e0e..4df723b930 100644 --- a/jOOQ/src/main/java/org/jooq/CreateSequenceFlagsStep.java +++ b/jOOQ/src/main/java/org/jooq/CreateSequenceFlagsStep.java @@ -69,6 +69,8 @@ public interface CreateSequenceFlagsStep extends CreateSequenceFinalStep { /** * Add the START WITH clause to the CREATE SEQUENCE statement. + * + * @param startWith is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES }) @NotNull @CheckReturnValue @@ -83,6 +85,8 @@ public interface CreateSequenceFlagsStep extends CreateSequenceFinalStep { /** * Add the INCREMENT BY clause to the CREATE SEQUENCE statement. + * + * @param incrementBy is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, POSTGRES }) @NotNull @CheckReturnValue @@ -97,6 +101,8 @@ public interface CreateSequenceFlagsStep extends CreateSequenceFinalStep { /** * Add the MINVALUE clause to the CREATE SEQUENCE statement. + * + * @param minvalue is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, POSTGRES }) @NotNull @CheckReturnValue @@ -118,6 +124,8 @@ public interface CreateSequenceFlagsStep extends CreateSequenceFinalStep { /** * Add the MAXVALUE clause to the CREATE SEQUENCE statement. + * + * @param maxvalue is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, POSTGRES }) @NotNull @CheckReturnValue @@ -153,6 +161,8 @@ public interface CreateSequenceFlagsStep extends CreateSequenceFinalStep { /** * Add the CACHE clause to the CREATE SEQUENCE statement. + * + * @param cache is wrapped as {@link org.jooq.impl.DSL#val(T)}. */ @Support({ CUBRID, H2, MARIADB, POSTGRES }) @NotNull @CheckReturnValue diff --git a/jOOQ/src/main/java/org/jooq/SignalSetStep.java b/jOOQ/src/main/java/org/jooq/SignalSetStep.java index 33f3faa804..c0fff31448 100644 --- a/jOOQ/src/main/java/org/jooq/SignalSetStep.java +++ b/jOOQ/src/main/java/org/jooq/SignalSetStep.java @@ -83,6 +83,8 @@ package org.jooq; + + diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java index 093f12129e..1d5d71889e 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DSL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java @@ -16102,6 +16102,8 @@ public class DSL { /** * The ABS function. + * + * @param number is wrapped as {@link #val(T)}. */ @NotNull @Support @@ -16120,6 +16122,8 @@ public class DSL { /** * The ACOS function. + * + * @param number is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16138,6 +16142,8 @@ public class DSL { /** * The ASIN function. + * + * @param number is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16156,6 +16162,8 @@ public class DSL { /** * The ATAN function. + * + * @param number is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16174,6 +16182,9 @@ public class DSL { /** * The ATAN2 function. + * + * @param x is wrapped as {@link #val(T)}. + * @param y is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16183,6 +16194,8 @@ public class DSL { /** * The ATAN2 function. + * + * @param x is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16192,6 +16205,8 @@ public class DSL { /** * The ATAN2 function. + * + * @param y is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16212,6 +16227,8 @@ public class DSL { * The CEIL function. *

* Get the smallest integer value equal or greater to a value. + * + * @param value is wrapped as {@link #val(T)}. */ @NotNull @Support @@ -16232,6 +16249,8 @@ public class DSL { /** * The COS function. + * + * @param number is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16250,6 +16269,8 @@ public class DSL { /** * The COSH function. + * + * @param number is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16268,6 +16289,8 @@ public class DSL { /** * The COT function. + * + * @param number is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16286,6 +16309,8 @@ public class DSL { /** * The COTH function. + * + * @param number is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16341,6 +16366,8 @@ public class DSL { /** * The EXP function. + * + * @param value is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16361,6 +16388,8 @@ public class DSL { * The FLOOR function. *

* Get the biggest integer value equal or less than a value. + * + * @param value is wrapped as {@link #val(T)}. */ @NotNull @Support @@ -16381,6 +16410,8 @@ public class DSL { /** * The LN function. + * + * @param value is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16399,6 +16430,9 @@ public class DSL { /** * The LOG function. + * + * @param value is wrapped as {@link #val(T)}. + * @param base is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16408,6 +16442,8 @@ public class DSL { /** * The LOG function. + * + * @param value is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16417,6 +16453,8 @@ public class DSL { /** * The LOG function. + * + * @param base is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16435,6 +16473,8 @@ public class DSL { /** * The LOG10 function. + * + * @param value is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16464,6 +16504,9 @@ public class DSL { /** * The POWER function. + * + * @param value is wrapped as {@link #val(T)}. + * @param exponent is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16473,6 +16516,8 @@ public class DSL { /** * The POWER function. + * + * @param value is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16482,6 +16527,8 @@ public class DSL { /** * The POWER function. + * + * @param exponent is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16621,6 +16668,8 @@ public class DSL { * The SIGN function. *

* Get the sign of a number and return it as any of +1, 0, -1. + * + * @param number is wrapped as {@link #val(T)}. */ @NotNull @Support @@ -16641,6 +16690,8 @@ public class DSL { /** * The SIN function. + * + * @param number is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16659,6 +16710,8 @@ public class DSL { /** * The SINH function. + * + * @param number is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16677,6 +16730,8 @@ public class DSL { /** * The SQRT function. + * + * @param value is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16695,6 +16750,8 @@ public class DSL { /** * The SQUARE function. + * + * @param value is wrapped as {@link #val(T)}. */ @NotNull @Support @@ -16713,6 +16770,8 @@ public class DSL { /** * The TAN function. + * + * @param number is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16731,6 +16790,8 @@ public class DSL { /** * The TANH function. + * + * @param number is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES }) @@ -16854,6 +16915,8 @@ public class DSL { * The ASCII function. *

* The ASCII value of a character. + * + * @param string is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) @@ -16876,6 +16939,8 @@ public class DSL { * The BIT_LENGTH function. *

* The length of a string in bits. + * + * @param string is wrapped as {@link #val(T)}. */ @NotNull @Support @@ -16898,6 +16963,8 @@ public class DSL { * The CHAR_LENGTH function. *

* The length of a string in characters. + * + * @param string is wrapped as {@link #val(T)}. */ @NotNull @Support @@ -16918,6 +16985,8 @@ public class DSL { /** * The CHR function. + * + * @param number is wrapped as {@link #val(T)}. */ @NotNull @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) @@ -16936,6 +17005,8 @@ public class DSL { /** * The DIGITS function. + * + * @param value is wrapped as {@link #val(T)}. */ @NotNull @Support @@ -17012,6 +17083,8 @@ public class DSL { * The LENGTH function, an alias for the CHAR_LENGTH function. *

* The length of a string in characters. + * + * @param string is wrapped as {@link #val(T)}. */ @NotNull @Support @@ -17034,6 +17107,8 @@ public class DSL { * The LOWER function. *

* Turn a string into lower case. + * + * @param string is wrapped as {@link #val(T)}. */ @NotNull @Support @@ -17226,6 +17301,8 @@ public class DSL { * The MD5 function. *

* Calculate an MD5 hash from a string. + * + * @param string is wrapped as {@link #val(T)}. */ @NotNull @Support({ MARIADB, MYSQL, POSTGRES }) @@ -17336,6 +17413,8 @@ public class DSL { * The OCTET_LENGTH function. *

* The length of a string in octets. + * + * @param string is wrapped as {@link #val(T)}. */ @NotNull @Support @@ -17740,6 +17819,8 @@ public class DSL { * The REVERSE function. *

* Reverse a string. + * + * @param string is wrapped as {@link #val(T)}. */ @NotNull @Support({ CUBRID, HSQLDB, MARIADB, MYSQL, POSTGRES }) @@ -18360,6 +18441,8 @@ public class DSL { * The TO_HEX function. *

* Format a number to its hex value. + * + * @param value is wrapped as {@link #val(T)}. */ @NotNull @Support({ H2, MARIADB, MYSQL, POSTGRES, SQLITE }) @@ -18580,6 +18663,8 @@ public class DSL { * The UPPER function. *

* Turn a string into upper case. + * + * @param string is wrapped as {@link #val(T)}. */ @NotNull @Support @@ -19211,6 +19296,8 @@ public class DSL { /** * The XMLCOMMENT function. + * + * @param comment is wrapped as {@link #val(T)}. */ @NotNull @Support({ POSTGRES }) @@ -19669,6 +19756,10 @@ public class DSL { + + + + diff --git a/jOOQ/src/main/java/org/jooq/impl/MergeImpl.java b/jOOQ/src/main/java/org/jooq/impl/MergeImpl.java index 4dba16b47e..578b95301d 100644 --- a/jOOQ/src/main/java/org/jooq/impl/MergeImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/MergeImpl.java @@ -48,6 +48,7 @@ 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; // ... diff --git a/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java b/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java index 83a0d59ea3..9d8752a7cf 100644 --- a/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java @@ -108,6 +108,7 @@ import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.function.BiFunction; +import java.util.function.BooleanSupplier; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; @@ -2022,10 +2023,7 @@ final class DefaultParseContext extends AbstractScope implements ParseContext { table = parseTableName(); } - TableLike usingTable = (table != null ? table : using); - if (parseKeywordIf("AS") || !peekKeyword("ON")) - usingTable = usingTable.asTable(parseIdentifier()); - + TableLike usingTable = parseCorrelationNameIf(table != null ? table : using, () -> peekKeyword("ON")); parseKeyword("ON"); Condition on = parseCondition(); boolean update = false; @@ -6330,26 +6328,7 @@ final class DefaultParseContext extends AbstractScope implements ParseContext { } // TODO UNPIVOT - - Name alias = null; - List columnAliases = null; - - if (parseKeywordIf("AS")) - alias = parseIdentifier(); - else if (!peekKeyword(KEYWORDS_IN_FROM) && !peekKeyword(KEYWORDS_IN_STATEMENTS)) - alias = parseIdentifierIf(); - - if (alias != null) { - if (parseIf('(')) { - columnAliases = parseIdentifiers(); - parse(')'); - } - - if (columnAliases != null) - result = t(result, true).as(alias, columnAliases.toArray(EMPTY_NAME)); - else - result = t(result, true).as(alias); - } + result = parseCorrelationNameIf(result, () -> peekKeyword(KEYWORDS_IN_FROM) || peekKeyword(KEYWORDS_IN_STATEMENTS)); int p = position(); if (parseKeywordIf("WITH")) { @@ -6370,6 +6349,30 @@ final class DefaultParseContext extends AbstractScope implements ParseContext { return t(result); } + private final TableLike parseCorrelationNameIf(TableLike result, BooleanSupplier forbiddenKeywords) { + Name alias = null; + List columnAliases = null; + + if (parseKeywordIf("AS")) + alias = parseIdentifier(); + else if (!forbiddenKeywords.getAsBoolean()) + alias = parseIdentifierIf(); + + if (alias != null) { + if (parseIf('(')) { + columnAliases = parseIdentifiers(); + parse(')'); + } + + if (columnAliases != null) + result = t(result, true).as(alias, columnAliases.toArray(EMPTY_NAME)); + else + result = t(result, true).as(alias); + } + + return result; + } +