diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java index 17b68345c7..709b7628b2 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DSL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java @@ -15151,6 +15151,17 @@ public class DSL { return new Degrees(radians); } + /** + * The E function. + *

+ * The E literal (Euler number). + */ + @NotNull + @Support + public static Field e() { + return new E(); + } + /** * The FLOOR function. *

@@ -15637,6 +15648,17 @@ public class DSL { return new Overlay(in, placing, startIndex); } + /** + * The PI function. + *

+ * The π literal. + */ + @NotNull + @Support + public static Field pi() { + return new Pi(); + } + /** * The POSITION function. *

@@ -16571,6 +16593,17 @@ public class DSL { return new Substring(string, startingPosition); } + /** + * The TAU function. + *

+ * The τ literal, or π, in a better world. + */ + @NotNull + @Support + public static Field tau() { + return new Tau(); + } + /** * The TO_CHAR function. *

@@ -26652,45 +26685,6 @@ public class DSL { return inline(2); } - /** - * The π literal. - *

- * This will be any of the following: - *

- */ - @NotNull - @Support - public static Field pi() { - return new Pi(); - } - - /** - * The τ literal, or π, in a better world. - */ - @NotNull - @Support - public static Field tau() { - return imul(pi(), two()); - } - - /** - * The E literal (Euler number). - *

- * This will be any of the following: - *

- */ - @NotNull - @Support - public static Field e() { - return new Euler(); - } - // ------------------------------------------------------------------------- // XXX utility API // ------------------------------------------------------------------------- diff --git a/jOOQ/src/main/java/org/jooq/impl/Euler.java b/jOOQ/src/main/java/org/jooq/impl/E.java similarity index 56% rename from jOOQ/src/main/java/org/jooq/impl/Euler.java rename to jOOQ/src/main/java/org/jooq/impl/E.java index 27f1504c25..615ef3b9f9 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Euler.java +++ b/jOOQ/src/main/java/org/jooq/impl/E.java @@ -37,30 +37,47 @@ */ package org.jooq.impl; -import static org.jooq.impl.DSL.function; -import static org.jooq.impl.DSL.inline; -import static org.jooq.impl.DSL.one; -import static org.jooq.impl.Names.N_E; -import static org.jooq.impl.SQLDataType.NUMERIC; +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 org.jooq.tools.*; + +import java.util.*; import java.math.BigDecimal; -import org.jooq.Context; /** - * @author Lukas Eder + * The E statement. */ -final class Euler extends AbstractField { +@SuppressWarnings({ "unused" }) +final class E +extends + AbstractField +{ - /** - * Generated UID - */ - private static final long serialVersionUID = -420788300355442056L; + private static final long serialVersionUID = 1L; - Euler() { - super(N_E, NUMERIC.notNull()); + E() { + super( + N_E, + allNotNull(NUMERIC) + ); } + // ------------------------------------------------------------------------- + // XXX: QueryPart API + // ------------------------------------------------------------------------- + + + @Override public final void accept(Context ctx) { switch (ctx.family()) { @@ -100,8 +117,23 @@ final class Euler extends AbstractField { // The Euler number doesn't seem to exist in any dialect... default: - ctx.visit(function("e", getDataType())); + ctx.visit(function(N_E, getDataType())); return; } } + + + + // ------------------------------------------------------------------------- + // The Object API + // ------------------------------------------------------------------------- + + @Override + public boolean equals(Object that) { + if (that instanceof E) { + return true; + } + else + return super.equals(that); + } } diff --git a/jOOQ/src/main/java/org/jooq/impl/Names.java b/jOOQ/src/main/java/org/jooq/impl/Names.java index 9ac00a02d8..e51458e324 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Names.java +++ b/jOOQ/src/main/java/org/jooq/impl/Names.java @@ -209,7 +209,6 @@ final class Names { static final Name N_RAWTOHEX = unquotedName("rawtohex"); static final Name N_REGEXP_REPLACE = unquotedName("regexp_replace"); static final Name N_REGEX_REPLACE = unquotedName("regex_replace"); - static final Name N_REGR_AVGX = unquotedName("regr_avgx"); static final Name N_REGR_AVGY = unquotedName("regr_avgy"); static final Name N_REGR_COUNT = unquotedName("regr_count"); @@ -280,6 +279,7 @@ final class Names { static final Name N_TO_DATE = unquotedName("to_date"); static final Name N_TO_NUMBER = unquotedName("to_number"); static final Name N_TO_TIMESTAMP = unquotedName("to_timestamp"); + static final Name N_TAU = unquotedName("tau"); static final Name N_TRANSLATE = unquotedName("translate"); static final Name N_TRIM = unquotedName("trim"); static final Name N_TRUNC = unquotedName("trunc"); diff --git a/jOOQ/src/main/java/org/jooq/impl/Pi.java b/jOOQ/src/main/java/org/jooq/impl/Pi.java index f943a3b96f..dda8961355 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Pi.java +++ b/jOOQ/src/main/java/org/jooq/impl/Pi.java @@ -37,32 +37,47 @@ */ package org.jooq.impl; -import static org.jooq.impl.DSL.function; -import static org.jooq.impl.DSL.inline; -import static org.jooq.impl.DSL.one; -import static org.jooq.impl.DSL.two; -import static org.jooq.impl.Internal.imul; -import static org.jooq.impl.Names.N_PI; -import static org.jooq.impl.SQLDataType.NUMERIC; +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 org.jooq.tools.*; + +import java.util.*; import java.math.BigDecimal; -import org.jooq.Context; /** - * @author Lukas Eder + * The PI statement. */ -final class Pi extends AbstractField { +@SuppressWarnings({ "unused" }) +final class Pi +extends + AbstractField +{ - /** - * Generated UID - */ - private static final long serialVersionUID = -420788300355442056L; + private static final long serialVersionUID = 1L; Pi() { - super(N_PI, NUMERIC.notNull()); + super( + N_PI, + allNotNull(NUMERIC) + ); } + // ------------------------------------------------------------------------- + // XXX: QueryPart API + // ------------------------------------------------------------------------- + + + @Override public final void accept(Context ctx) { switch (ctx.family()) { @@ -86,4 +101,19 @@ final class Pi extends AbstractField { return; } } + + + + // ------------------------------------------------------------------------- + // The Object API + // ------------------------------------------------------------------------- + + @Override + public boolean equals(Object that) { + if (that instanceof Pi) { + return true; + } + else + return super.equals(that); + } } diff --git a/jOOQ/src/main/java/org/jooq/impl/Tau.java b/jOOQ/src/main/java/org/jooq/impl/Tau.java new file mode 100644 index 0000000000..6372c0f327 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/Tau.java @@ -0,0 +1,100 @@ +/* + * 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.impl; + +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 org.jooq.tools.*; + +import java.util.*; +import java.math.BigDecimal; + + +/** + * The TAU statement. + */ +@SuppressWarnings({ "unused" }) +final class Tau +extends + AbstractField +{ + + private static final long serialVersionUID = 1L; + + Tau() { + super( + N_TAU, + allNotNull(NUMERIC) + ); + } + + // ------------------------------------------------------------------------- + // XXX: QueryPart API + // ------------------------------------------------------------------------- + + + + @Override + public final void accept(Context ctx) { + ctx.visit(imul(pi(), two())); + } + + + + // ------------------------------------------------------------------------- + // The Object API + // ------------------------------------------------------------------------- + + @Override + public boolean equals(Object that) { + if (that instanceof Tau) { + return true; + } + else + return super.equals(that); + } +}