cos(Number value) {
- return cos(Tools.field(value));
- }
-
- /**
- * Get the cosine(field) function.
- *
- * This renders the cos function where available:
- * cos([field])
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
- public static Field cos(Field extends Number> field) {
- return function(N_COS, SQLDataType.NUMERIC, field);
- }
-
- /**
- * Get the sine(field) function.
- *
- * @see #sin(Field)
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
- public static Field sin(Number value) {
- return sin(Tools.field(value));
- }
-
- /**
- * Get the sine(field) function.
- *
- * This renders the sin function where available:
- * sin([field])
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
- public static Field sin(Field extends Number> field) {
- return function(N_SIN, SQLDataType.NUMERIC, field);
- }
-
/**
* Get the tangent(field) function.
*
@@ -20035,78 +20090,6 @@ public class DSL {
return function(N_TAN, SQLDataType.NUMERIC, field);
}
- /**
- * Get the cotangent(field) function.
- *
- * @see #cot(Field)
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
- public static Field cot(Number value) {
- return cot(Tools.field(value));
- }
-
- /**
- * Get the cotangent(field) function.
- *
- * This renders the cot function where available:
- * cot([field])
... or emulates it elsewhere using
- * sin and cos: cos([field]) / sin([field])
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
- public static Field cot(Field extends Number> field) {
- return new Cot(Tools.nullSafe(field));
- }
-
- /**
- * Get the hyperbolic sine function: sinh(field).
- *
- * @see #sinh(Field)
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
- public static Field sinh(Number value) {
- return sinh(Tools.field(value));
- }
-
- /**
- * Get the hyperbolic sine function: sinh(field).
- *
- * This renders the sinh function where available:
- * sinh([field])
... or emulates it elsewhere using
- * exp: (exp([field] * 2) - 1) / (exp([field] * 2))
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
- public static Field sinh(Field extends Number> field) {
- return new Sinh(Tools.nullSafe(field));
- }
-
- /**
- * Get the hyperbolic cosine function: cosh(field).
- *
- * @see #cosh(Field)
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
- public static Field cosh(Number value) {
- return cosh(Tools.field(value));
- }
-
- /**
- * Get the hyperbolic cosine function: cosh(field).
- *
- * This renders the cosh function where available:
- * cosh([field])
... or emulates it elsewhere using
- * exp: (exp([field] * 2) + 1) / (exp([field] * 2))
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
- public static Field cosh(Field extends Number> field) {
- return new Cosh(Tools.nullSafe(field));
- }
-
/**
* Get the hyperbolic tangent function: tanh(field).
*
@@ -20132,33 +20115,6 @@ public class DSL {
return new Tanh(Tools.nullSafe(field));
}
- /**
- * Get the hyperbolic cotangent function: coth(field).
- *
- * @see #coth(Field)
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
- public static Field coth(Number value) {
- return coth(Tools.field(value));
- }
-
- /**
- * Get the hyperbolic cotangent function: coth(field).
- *
- * This is not supported by any RDBMS, but emulated using exp exp:
- * (exp([field] * 2) + 1) / (exp([field] * 2) - 1)
- */
- @NotNull
- @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
- public static Field coth(Field extends Number> field) {
- field = Tools.nullSafe(field);
- return idiv(
- iadd(exp(imul(field, two())), one()),
- isub(exp(imul(field, two())), one())
- );
- }
-
diff --git a/jOOQ/src/main/java/org/jooq/impl/Names.java b/jOOQ/src/main/java/org/jooq/impl/Names.java
index 1c475f31d2..0e2a3b769f 100644
--- a/jOOQ/src/main/java/org/jooq/impl/Names.java
+++ b/jOOQ/src/main/java/org/jooq/impl/Names.java
@@ -88,6 +88,7 @@ final class Names {
static final Name N_COS = unquotedName("cos");
static final Name N_COSH = unquotedName("cosh");
static final Name N_COT = unquotedName("cot");
+ static final Name N_COTH = unquotedName("coth");
static final Name N_COUNT = unquotedName("count");
static final Name N_COUNTSET = unquotedName("countset");
static final Name N_CURRENT_BIGDATETIME = unquotedName("current_bigdatetime");
diff --git a/jOOQ/src/main/java/org/jooq/impl/Sin.java b/jOOQ/src/main/java/org/jooq/impl/Sin.java
new file mode 100644
index 0000000000..8e1c28125f
--- /dev/null
+++ b/jOOQ/src/main/java/org/jooq/impl/Sin.java
@@ -0,0 +1,88 @@
+/*
+ * 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 java.math.*;
+import java.util.*;
+
+/**
+ * The SIN statement.
+ */
+@SuppressWarnings({ "rawtypes", "unchecked", "unused" })
+final class Sin
+extends
+ AbstractField
+{
+
+ private static final long serialVersionUID = 1L;
+
+ private final Field extends Number> number;
+
+ Sin(
+ Field extends Number> number
+ ) {
+ super(N_SIN, allNotNull(NUMERIC, number));
+
+ this.number = nullSafeNotNull(number, INTEGER);
+ }
+
+ // -------------------------------------------------------------------------
+ // XXX: QueryPart API
+ // -------------------------------------------------------------------------
+
+
+
+ @Override
+ public final void accept(Context> ctx) {
+ ctx.visit(function(N_SIN, getDataType(), number));
+ }
+
+
+}
diff --git a/jOOQ/src/main/java/org/jooq/impl/Sinh.java b/jOOQ/src/main/java/org/jooq/impl/Sinh.java
index fd143f5e75..734d072d1c 100644
--- a/jOOQ/src/main/java/org/jooq/impl/Sinh.java
+++ b/jOOQ/src/main/java/org/jooq/impl/Sinh.java
@@ -37,37 +37,48 @@
*/
package org.jooq.impl;
-import static org.jooq.impl.DSL.one;
-import static org.jooq.impl.DSL.two;
-import static org.jooq.impl.Internal.idiv;
-import static org.jooq.impl.Internal.imul;
-import static org.jooq.impl.Internal.isub;
-import static org.jooq.impl.Names.N_SINH;
-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 java.math.BigDecimal;
+import org.jooq.*;
+import org.jooq.impl.*;
-import org.jooq.Context;
-import org.jooq.Field;
+import java.math.*;
+import java.util.*;
/**
- * @author Lukas Eder
+ * The SINH statement.
*/
-final class Sinh extends AbstractField {
+@SuppressWarnings({ "rawtypes", "unchecked", "unused" })
+final class Sinh
+extends
+ AbstractField
+{
- /**
- * Generated UID
- */
- private static final long serialVersionUID = -7273879239726265322L;
+ private static final long serialVersionUID = 1L;
- private final Field extends Number> argument;
+ private final Field extends Number> number;
- Sinh(Field extends Number> argument) {
- super(N_SINH, NUMERIC);
+ Sinh(
+ Field extends Number> number
+ ) {
+ super(N_SINH, allNotNull(NUMERIC, number));
- this.argument = argument;
+ this.number = nullSafeNotNull(number, INTEGER);
}
+ // -------------------------------------------------------------------------
+ // XXX: QueryPart API
+ // -------------------------------------------------------------------------
+
+
+
@Override
public final void accept(Context> ctx) {
switch (ctx.family()) {
@@ -91,14 +102,16 @@ final class Sinh extends AbstractField {
case MYSQL:
case POSTGRES:
ctx.visit(idiv(
- isub(DSL.exp(imul(argument, two())), one()),
- imul(DSL.exp(argument), two())
+ isub(DSL.exp(imul(number, two())), one()),
+ imul(DSL.exp(number), two())
));
break;
default:
- ctx.visit(N_SINH).sql('(').visit(argument).sql(')');
+ ctx.visit(N_SINH).sql('(').visit(number).sql(')');
break;
}
}
+
+
}