[jOOQ/jOOQ#10025] Move Keywords.F_XYZ to Names.N_XYZ and make them unquotedName
This commit is contained in:
parent
aecdb2b575
commit
a26b6cbc6d
@ -149,6 +149,17 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -39,7 +39,6 @@ package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.DSL.two;
|
||||
import static org.jooq.impl.Keywords.F_ACOS;
|
||||
import static org.jooq.impl.Names.N_ACOS;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -74,7 +73,7 @@ final class Acos extends AbstractField<BigDecimal> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(F_ACOS).sql('(').visit(arg).sql(')');
|
||||
ctx.visit(N_ACOS).sql('(').visit(arg).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,10 +37,9 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_ASC;
|
||||
import static org.jooq.impl.Keywords.F_ASCII;
|
||||
import static org.jooq.impl.Keywords.F_ASCII_VAL;
|
||||
import static org.jooq.impl.Names.N_ASC;
|
||||
import static org.jooq.impl.Names.N_ASCII;
|
||||
import static org.jooq.impl.Names.N_ASCII_VAL;
|
||||
|
||||
import org.jooq.Context;
|
||||
import org.jooq.Field;
|
||||
@ -73,7 +72,7 @@ final class Ascii extends AbstractField<Integer> {
|
||||
|
||||
|
||||
case FIREBIRD:
|
||||
ctx.visit(F_ASCII_VAL).sql('(').visit(string).sql(')');
|
||||
ctx.visit(N_ASCII_VAL).sql('(').visit(string).sql(')');
|
||||
break;
|
||||
|
||||
// TODO [#862] [#864] emulate this for some dialects
|
||||
@ -84,7 +83,7 @@ final class Ascii extends AbstractField<Integer> {
|
||||
case SQLITE:
|
||||
|
||||
default:
|
||||
ctx.visit(F_ASCII).sql('(').visit(string).sql(')');
|
||||
ctx.visit(N_ASCII).sql('(').visit(string).sql(')');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,6 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.Keywords.F_ASIN;
|
||||
import static org.jooq.impl.Names.N_ASIN;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -73,7 +72,7 @@ final class Asin extends AbstractField<BigDecimal> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(F_ASIN).sql('(').visit(arg).sql(')');
|
||||
ctx.visit(N_ASIN).sql('(').visit(arg).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,9 +37,8 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_ATAN;
|
||||
import static org.jooq.impl.Keywords.F_ATN;
|
||||
import static org.jooq.impl.Names.N_ATAN;
|
||||
import static org.jooq.impl.Names.N_ATN;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@ -73,7 +72,7 @@ final class Atan extends AbstractField<BigDecimal> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(F_ATAN).sql('(').visit(arg).sql(')');
|
||||
ctx.visit(N_ATAN).sql('(').visit(arg).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,9 +38,8 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.Keywords.F_BIT_COUNT;
|
||||
import static org.jooq.impl.Keywords.F_COUNTSET;
|
||||
import static org.jooq.impl.Names.N_BIT_COUNT;
|
||||
import static org.jooq.impl.Names.N_COUNTSET;
|
||||
|
||||
import org.jooq.Context;
|
||||
import org.jooq.Field;
|
||||
@ -72,7 +71,7 @@ final class BitCount extends AbstractField<Integer> {
|
||||
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
ctx.visit(F_BIT_COUNT).sql('(').visit(field).sql(')');
|
||||
ctx.visit(N_BIT_COUNT).sql('(').visit(field).sql(')');
|
||||
return;
|
||||
|
||||
|
||||
@ -247,7 +246,7 @@ final class BitCount extends AbstractField<Integer> {
|
||||
}
|
||||
else {
|
||||
// Currently not supported
|
||||
ctx.visit(F_BIT_COUNT).sql('(').visit(field).sql(')');
|
||||
ctx.visit(N_BIT_COUNT).sql('(').visit(field).sql(')');
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -407,7 +406,7 @@ final class BitCount extends AbstractField<Integer> {
|
||||
}
|
||||
else {
|
||||
// Currently not supported
|
||||
ctx.visit(F_BIT_COUNT).sql('(').visit(field).sql(')');
|
||||
ctx.visit(N_BIT_COUNT).sql('(').visit(field).sql(')');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,6 +39,7 @@ package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.DSL.zero;
|
||||
import static org.jooq.impl.Names.N_BOOL_AND;
|
||||
|
||||
import org.jooq.Condition;
|
||||
import org.jooq.Context;
|
||||
@ -57,7 +58,7 @@ final class BoolAnd extends DefaultAggregateFunction<Boolean> {
|
||||
private final Condition condition;
|
||||
|
||||
BoolAnd(Condition condition) {
|
||||
super("bool_and", SQLDataType.BOOLEAN, DSL.field(condition));
|
||||
super(N_BOOL_AND, SQLDataType.BOOLEAN, DSL.field(condition));
|
||||
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
@ -39,6 +39,7 @@ package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.DSL.zero;
|
||||
import static org.jooq.impl.Names.N_BOOL_OR;
|
||||
|
||||
import org.jooq.Condition;
|
||||
import org.jooq.Context;
|
||||
@ -57,7 +58,7 @@ final class BoolOr extends DefaultAggregateFunction<Boolean> {
|
||||
private final Condition condition;
|
||||
|
||||
BoolOr(Condition condition) {
|
||||
super("bool_or", SQLDataType.BOOLEAN, DSL.field(condition));
|
||||
super(N_BOOL_OR, SQLDataType.BOOLEAN, DSL.field(condition));
|
||||
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
@ -38,14 +38,14 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.Keywords.F_TO_CLOB;
|
||||
import static org.jooq.impl.Keywords.F_TO_DATE;
|
||||
import static org.jooq.impl.Keywords.F_TO_TIMESTAMP;
|
||||
import static org.jooq.impl.Keywords.K_AS;
|
||||
import static org.jooq.impl.Keywords.K_CAST;
|
||||
import static org.jooq.impl.Keywords.K_DECIMAL;
|
||||
import static org.jooq.impl.Keywords.K_TRIM;
|
||||
import static org.jooq.impl.Names.N_CAST;
|
||||
import static org.jooq.impl.Names.N_TO_CLOB;
|
||||
import static org.jooq.impl.Names.N_TO_DATE;
|
||||
import static org.jooq.impl.Names.N_TO_TIMESTAMP;
|
||||
import static org.jooq.impl.SQLDataType.BOOLEAN;
|
||||
import static org.jooq.impl.SQLDataType.DOUBLE;
|
||||
import static org.jooq.impl.SQLDataType.FLOAT;
|
||||
|
||||
@ -37,9 +37,8 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_CEIL;
|
||||
import static org.jooq.impl.Keywords.F_CEILING;
|
||||
import static org.jooq.impl.Names.N_CEIL;
|
||||
import static org.jooq.impl.Names.N_CEILING;
|
||||
|
||||
import org.jooq.Context;
|
||||
import org.jooq.Field;
|
||||
@ -84,11 +83,11 @@ final class Ceil<T extends Number> extends AbstractField<T> {
|
||||
|
||||
|
||||
case H2:
|
||||
ctx.visit(F_CEILING).sql('(').visit(argument).sql(')');
|
||||
ctx.visit(N_CEILING).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_CEIL).sql('(').visit(argument).sql(')');
|
||||
ctx.visit(N_CEIL).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -188,8 +188,6 @@ package org.jooq.impl;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -39,7 +39,6 @@ package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.DSL.two;
|
||||
import static org.jooq.impl.Keywords.F_COSH;
|
||||
import static org.jooq.impl.Names.N_COSH;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -91,7 +90,7 @@ final class Cosh extends AbstractField<BigDecimal> {
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_COSH).sql('(').visit(argument).sql(')');
|
||||
ctx.visit(N_COSH).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_COT;
|
||||
import static org.jooq.impl.Names.N_COT;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -77,7 +76,7 @@ final class Cot extends AbstractField<BigDecimal> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(F_COT).sql('(').visit(argument).sql(')');
|
||||
ctx.visit(N_COT).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,15 +37,14 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_CONVERT;
|
||||
import static org.jooq.impl.Keywords.F_CURRENT_DATE;
|
||||
import static org.jooq.impl.Keywords.F_CURRENT_TIMESTAMP;
|
||||
import static org.jooq.impl.Keywords.F_SYSDATE;
|
||||
import static org.jooq.impl.Keywords.F_TRUNC;
|
||||
import static org.jooq.impl.Keywords.K_CURRENT;
|
||||
import static org.jooq.impl.Keywords.K_DATE;
|
||||
import static org.jooq.impl.Keywords.K_YEAR_TO_DAY;
|
||||
import static org.jooq.impl.Names.N_CONVERT;
|
||||
import static org.jooq.impl.Names.N_CURRENT_DATE;
|
||||
import static org.jooq.impl.Names.N_CURRENT_TIMESTAMP;
|
||||
import static org.jooq.impl.Names.N_SYSDATE;
|
||||
import static org.jooq.impl.Names.N_TRUNC;
|
||||
|
||||
import org.jooq.Context;
|
||||
import org.jooq.DataType;
|
||||
@ -105,10 +104,10 @@ final class CurrentDate<T> extends AbstractField<T> {
|
||||
case HSQLDB:
|
||||
case POSTGRES:
|
||||
case SQLITE:
|
||||
ctx.visit(F_CURRENT_DATE);
|
||||
ctx.visit(N_CURRENT_DATE);
|
||||
break;
|
||||
default:
|
||||
ctx.visit(F_CURRENT_DATE).sql("()");
|
||||
ctx.visit(N_CURRENT_DATE).sql("()");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,13 +38,13 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.Keywords.F_SCHEMA_NAME;
|
||||
import static org.jooq.impl.Keywords.F_USER;
|
||||
import static org.jooq.impl.Keywords.K_CURRENT;
|
||||
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.Names.N_CURRENT_SCHEMA;
|
||||
import static org.jooq.impl.Names.N_SCHEMA_NAME;
|
||||
import static org.jooq.impl.Names.N_USER;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
|
||||
import org.jooq.Context;
|
||||
|
||||
@ -37,13 +37,12 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_CONVERT;
|
||||
import static org.jooq.impl.Keywords.F_CURRENT_TIME;
|
||||
import static org.jooq.impl.Keywords.F_CURRENT_TIMESTAMP;
|
||||
import static org.jooq.impl.Keywords.K_CURRENT;
|
||||
import static org.jooq.impl.Keywords.K_HOUR_TO_SECOND;
|
||||
import static org.jooq.impl.Keywords.K_TIME;
|
||||
import static org.jooq.impl.Names.N_CONVERT;
|
||||
import static org.jooq.impl.Names.N_CURRENT_TIME;
|
||||
import static org.jooq.impl.Names.N_CURRENT_TIMESTAMP;
|
||||
|
||||
import org.jooq.Context;
|
||||
import org.jooq.DataType;
|
||||
@ -92,7 +91,7 @@ final class CurrentTime<T> extends AbstractField<T> {
|
||||
case HSQLDB:
|
||||
case POSTGRES:
|
||||
case SQLITE:
|
||||
ctx.visit(F_CURRENT_TIME);
|
||||
ctx.visit(N_CURRENT_TIME);
|
||||
break;
|
||||
|
||||
|
||||
@ -106,7 +105,7 @@ final class CurrentTime<T> extends AbstractField<T> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(F_CURRENT_TIME).sql("()");
|
||||
ctx.visit(N_CURRENT_TIME).sql("()");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,12 +49,11 @@ import static org.jooq.SQLDialect.DERBY;
|
||||
import static org.jooq.SQLDialect.SQLITE;
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.impl.Keywords.F_CURRENT_BIGDATETIME;
|
||||
import static org.jooq.impl.Keywords.F_CURRENT_TIMESTAMP;
|
||||
import static org.jooq.impl.Keywords.F_NOW;
|
||||
import static org.jooq.impl.Keywords.K_CURRENT;
|
||||
import static org.jooq.impl.Keywords.K_TIMESTAMP;
|
||||
import static org.jooq.impl.Names.N_CURRENT_BIGDATETIME;
|
||||
import static org.jooq.impl.Names.N_CURRENT_TIMESTAMP;
|
||||
import static org.jooq.impl.Names.N_NOW;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@ -125,15 +124,15 @@ final class CurrentTimestamp<T> extends AbstractField<T> {
|
||||
case POSTGRES:
|
||||
case SQLITE:
|
||||
if (precision != null && !NO_SUPPORT_PRECISION.contains(ctx.family()))
|
||||
ctx.visit(F_CURRENT_TIMESTAMP).sql('(').visit(precision).sql(')');
|
||||
ctx.visit(N_CURRENT_TIMESTAMP).sql('(').visit(precision).sql(')');
|
||||
else
|
||||
ctx.visit(F_CURRENT_TIMESTAMP);
|
||||
ctx.visit(N_CURRENT_TIMESTAMP);
|
||||
break;
|
||||
default:
|
||||
if (precision != null && !NO_SUPPORT_PRECISION.contains(ctx.family()))
|
||||
ctx.visit(F_CURRENT_TIMESTAMP).sql('(').visit(precision).sql(')');
|
||||
ctx.visit(N_CURRENT_TIMESTAMP).sql('(').visit(precision).sql(')');
|
||||
else
|
||||
ctx.visit(F_CURRENT_TIMESTAMP).sql("()");
|
||||
ctx.visit(N_CURRENT_TIMESTAMP).sql("()");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,10 +37,9 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_CURRENTUSER;
|
||||
import static org.jooq.impl.Keywords.F_CURRENT_USER;
|
||||
import static org.jooq.impl.Keywords.F_USER;
|
||||
import static org.jooq.impl.Names.N_CURRENTUSER;
|
||||
import static org.jooq.impl.Names.N_CURRENT_USER;
|
||||
import static org.jooq.impl.Names.N_USER;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -88,14 +87,14 @@ final class CurrentUser extends AbstractField<String> {
|
||||
case FIREBIRD:
|
||||
case HSQLDB:
|
||||
case POSTGRES:
|
||||
ctx.visit(F_CURRENT_USER);
|
||||
ctx.visit(N_CURRENT_USER);
|
||||
break;
|
||||
|
||||
case SQLITE:
|
||||
ctx.visit(DSL.inline(""));
|
||||
break;
|
||||
default:
|
||||
ctx.visit(F_CURRENT_USER).sql("()");
|
||||
ctx.visit(N_CURRENT_USER).sql("()");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,11 +39,6 @@ package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.sql;
|
||||
import static org.jooq.impl.Keywords.F_ADD_MONTHS;
|
||||
import static org.jooq.impl.Keywords.F_DATEADD;
|
||||
import static org.jooq.impl.Keywords.F_DATE_ADD;
|
||||
import static org.jooq.impl.Keywords.F_STRFTIME;
|
||||
import static org.jooq.impl.Keywords.F_TIMESTAMPADD;
|
||||
import static org.jooq.impl.Keywords.K_AS;
|
||||
import static org.jooq.impl.Keywords.K_CAST;
|
||||
import static org.jooq.impl.Keywords.K_DAY;
|
||||
@ -53,7 +48,11 @@ import static org.jooq.impl.Keywords.K_MINUTE;
|
||||
import static org.jooq.impl.Keywords.K_MONTH;
|
||||
import static org.jooq.impl.Keywords.K_SECOND;
|
||||
import static org.jooq.impl.Keywords.K_YEAR;
|
||||
import static org.jooq.impl.Names.N_ADD_MONTHS;
|
||||
import static org.jooq.impl.Names.N_DATEADD;
|
||||
import static org.jooq.impl.Names.N_DATE_ADD;
|
||||
import static org.jooq.impl.Names.N_STRFTIME;
|
||||
import static org.jooq.impl.Names.N_TIMESTAMPADD;
|
||||
|
||||
import org.jooq.Context;
|
||||
import org.jooq.DatePart;
|
||||
@ -105,7 +104,7 @@ final class DateAdd<T> extends AbstractField<T> {
|
||||
default: throwUnsupported();
|
||||
}
|
||||
|
||||
ctx.visit(F_DATE_ADD).sql('(').visit(date).sql(", ").visit(K_INTERVAL).sql(' ').visit(interval).sql(' ').visit(keyword).sql(')');
|
||||
ctx.visit(N_DATE_ADD).sql('(').visit(date).sql(", ").visit(K_INTERVAL).sql(' ').visit(interval).sql(' ').visit(keyword).sql(')');
|
||||
break;
|
||||
}
|
||||
|
||||
@ -121,7 +120,7 @@ final class DateAdd<T> extends AbstractField<T> {
|
||||
default: throwUnsupported();
|
||||
}
|
||||
|
||||
ctx.sql("{fn ").visit(F_TIMESTAMPADD).sql('(').visit(keyword).sql(", ").visit(interval).sql(", ").visit(date).sql(") }");
|
||||
ctx.sql("{fn ").visit(N_TIMESTAMPADD).sql('(').visit(keyword).sql(", ").visit(interval).sql(", ").visit(date).sql(") }");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -136,7 +135,7 @@ final class DateAdd<T> extends AbstractField<T> {
|
||||
default: throwUnsupported();
|
||||
}
|
||||
|
||||
ctx.visit(F_DATEADD).sql('(').visit(keyword).sql(", ").visit(interval).sql(", ").visit(date).sql(')');
|
||||
ctx.visit(N_DATEADD).sql('(').visit(keyword).sql(", ").visit(interval).sql(", ").visit(date).sql(')');
|
||||
break;
|
||||
}
|
||||
|
||||
@ -151,7 +150,7 @@ final class DateAdd<T> extends AbstractField<T> {
|
||||
default: throwUnsupported();
|
||||
}
|
||||
|
||||
ctx.visit(F_DATEADD).sql('(').visit(inline(string)).sql(", ").visit(interval).sql(", ").visit(date).sql(')');
|
||||
ctx.visit(N_DATEADD).sql('(').visit(inline(string)).sql(", ").visit(interval).sql(", ").visit(date).sql(')');
|
||||
break;
|
||||
}
|
||||
|
||||
@ -196,7 +195,7 @@ final class DateAdd<T> extends AbstractField<T> {
|
||||
default: throwUnsupported();
|
||||
}
|
||||
|
||||
ctx.visit(F_STRFTIME).sql("('%Y-%m-%d %H:%M:%f', ").visit(date).sql(", ").visit(interval.concat(inline(string))).sql(')');
|
||||
ctx.visit(N_STRFTIME).sql("('%Y-%m-%d %H:%M:%f', ").visit(date).sql(", ").visit(interval.concat(inline(string))).sql(')');
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -39,12 +39,11 @@ package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.function;
|
||||
import static org.jooq.impl.DSL.keyword;
|
||||
import static org.jooq.impl.Keywords.F_DATEDIFF;
|
||||
import static org.jooq.impl.Keywords.F_DAYS_BETWEEN;
|
||||
import static org.jooq.impl.Keywords.F_STRFTIME;
|
||||
import static org.jooq.impl.Keywords.F_TIMESTAMPDIFF;
|
||||
import static org.jooq.impl.Keywords.K_DAY;
|
||||
import static org.jooq.impl.Names.N_DATEDIFF;
|
||||
import static org.jooq.impl.Names.N_DAYS_BETWEEN;
|
||||
import static org.jooq.impl.Names.N_STRFTIME;
|
||||
import static org.jooq.impl.Names.N_TIMESTAMPDIFF;
|
||||
import static org.jooq.impl.Tools.castIfNeeded;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -79,15 +78,15 @@ final class DateDiff<T> extends AbstractField<Integer> {
|
||||
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
ctx.visit(F_DATEDIFF).sql('(').visit(date1).sql(", ").visit(date2).sql(')');
|
||||
ctx.visit(N_DATEDIFF).sql('(').visit(date1).sql(", ").visit(date2).sql(')');
|
||||
break;
|
||||
|
||||
case DERBY:
|
||||
ctx.sql("{fn ").visit(F_TIMESTAMPDIFF).sql('(').visit(keyword("sql_tsi_day")).sql(", ").visit(date2).sql(", ").visit(date1).sql(") }");
|
||||
ctx.sql("{fn ").visit(N_TIMESTAMPDIFF).sql('(').visit(keyword("sql_tsi_day")).sql(", ").visit(date2).sql(", ").visit(date1).sql(") }");
|
||||
break;
|
||||
|
||||
case FIREBIRD:
|
||||
ctx.visit(F_DATEDIFF).sql('(').visit(K_DAY).sql(", ").visit(date2).sql(", ").visit(date1).sql(')');
|
||||
ctx.visit(N_DATEDIFF).sql('(').visit(K_DAY).sql(", ").visit(date2).sql(", ").visit(date1).sql(')');
|
||||
break;
|
||||
|
||||
case H2:
|
||||
@ -95,11 +94,11 @@ final class DateDiff<T> extends AbstractField<Integer> {
|
||||
|
||||
|
||||
|
||||
ctx.visit(F_DATEDIFF).sql("('day', ").visit(date2).sql(", ").visit(date1).sql(')');
|
||||
ctx.visit(N_DATEDIFF).sql("('day', ").visit(date2).sql(", ").visit(date1).sql(')');
|
||||
break;
|
||||
|
||||
case SQLITE:
|
||||
ctx.sql('(').visit(F_STRFTIME).sql("('%s', ").visit(date1).sql(") - ").visit(F_STRFTIME).sql("('%s', ").visit(date2).sql(")) / 86400");
|
||||
ctx.sql('(').visit(N_STRFTIME).sql("('%s', ").visit(date1).sql(") - ").visit(N_STRFTIME).sql("('%s', ").visit(date2).sql(")) / 86400");
|
||||
break;
|
||||
|
||||
|
||||
|
||||
@ -37,10 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_STRFTIME;
|
||||
import static org.jooq.impl.Keywords.K_DATE;
|
||||
import static org.jooq.impl.Keywords.K_TIME;
|
||||
import static org.jooq.impl.Keywords.K_TIMESTAMP;
|
||||
import static org.jooq.impl.Names.N_STRFTIME;
|
||||
import static org.jooq.impl.Tools.castIfNeeded;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -102,7 +102,7 @@ final class DateOrTime<T> extends AbstractField<T> {
|
||||
// [#8733] No fractional seconds for time literals
|
||||
ctx.visit(K_TIME).sql('(').visit(field).sql(')');
|
||||
else
|
||||
ctx.visit(F_STRFTIME).sql("('%Y-%m-%d %H:%M:%f', ").visit(field).sql(')');
|
||||
ctx.visit(N_STRFTIME).sql("('%Y-%m-%d %H:%M:%f', ").visit(field).sql(')');
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +39,6 @@ package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.pi;
|
||||
import static org.jooq.impl.Keywords.F_DEGREES;
|
||||
import static org.jooq.impl.Names.N_DEGREES;
|
||||
import static org.jooq.impl.Tools.castIfNeeded;
|
||||
|
||||
@ -84,7 +83,7 @@ final class Degrees extends AbstractField<BigDecimal> {
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_DEGREES).sql('(').visit(argument).sql(')');
|
||||
ctx.visit(N_DEGREES).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ final class Dual extends AbstractTable<Record> {
|
||||
|
||||
|
||||
default:
|
||||
// [#7421] must not use Names.N_DUAL as quoting doesn't work in e.g. MySQL
|
||||
// [#7421] must not use N_DUAL as quoting doesn't work in e.g. MySQL
|
||||
ctx.sql("dual");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -73,10 +73,6 @@ import static org.jooq.impl.ExpressionOperator.BIT_XOR;
|
||||
import static org.jooq.impl.ExpressionOperator.SHL;
|
||||
import static org.jooq.impl.ExpressionOperator.SHR;
|
||||
import static org.jooq.impl.ExpressionOperator.SUBTRACT;
|
||||
import static org.jooq.impl.Keywords.F_DATEADD;
|
||||
import static org.jooq.impl.Keywords.F_DATE_ADD;
|
||||
import static org.jooq.impl.Keywords.F_STRFTIME;
|
||||
import static org.jooq.impl.Keywords.F_TIMESTAMPADD;
|
||||
import static org.jooq.impl.Keywords.K_AS;
|
||||
import static org.jooq.impl.Keywords.K_CAST;
|
||||
import static org.jooq.impl.Keywords.K_DAY;
|
||||
@ -88,6 +84,10 @@ import static org.jooq.impl.Keywords.K_MILLISECOND;
|
||||
import static org.jooq.impl.Keywords.K_MONTH;
|
||||
import static org.jooq.impl.Keywords.K_YEAR_MONTH;
|
||||
import static org.jooq.impl.Keywords.K_YEAR_TO_MONTH;
|
||||
import static org.jooq.impl.Names.N_DATEADD;
|
||||
import static org.jooq.impl.Names.N_DATE_ADD;
|
||||
import static org.jooq.impl.Names.N_STRFTIME;
|
||||
import static org.jooq.impl.Names.N_TIMESTAMPADD;
|
||||
import static org.jooq.impl.Tools.castIfNeeded;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
@ -336,18 +336,18 @@ final class Expression<T> extends AbstractField<T> {
|
||||
interval = interval.neg();
|
||||
|
||||
if (rhs.getType() == YearToMonth.class)
|
||||
ctx.visit(F_DATE_ADD).sql('(').visit(lhs).sql(", ").visit(K_INTERVAL).sql(' ')
|
||||
.visit(Tools.field(interval, SQLDataType.VARCHAR)).sql(' ').visit(K_YEAR_MONTH).sql(')');
|
||||
ctx.visit(N_DATE_ADD).sql('(').visit(lhs).sql(", ").visit(K_INTERVAL).sql(' ')
|
||||
.visit(Tools.field(interval, SQLDataType.VARCHAR)).sql(' ').visit(K_YEAR_MONTH).sql(')');
|
||||
else if (family == CUBRID)
|
||||
ctx.visit(F_DATE_ADD).sql('(').visit(lhs).sql(", ").visit(K_INTERVAL).sql(' ')
|
||||
.visit(Tools.field(interval, SQLDataType.VARCHAR)).sql(' ').visit(K_DAY_MILLISECOND).sql(')');
|
||||
ctx.visit(N_DATE_ADD).sql('(').visit(lhs).sql(", ").visit(K_INTERVAL).sql(' ')
|
||||
.visit(Tools.field(interval, SQLDataType.VARCHAR)).sql(' ').visit(K_DAY_MILLISECOND).sql(')');
|
||||
|
||||
// [#6820] Workaround for bugs:
|
||||
// https://bugs.mysql.com/bug.php?id=88573
|
||||
// https://jira.mariadb.org/browse/MDEV-14452
|
||||
else
|
||||
ctx.visit(F_DATE_ADD).sql('(').visit(lhs).sql(", ").visit(K_INTERVAL).sql(' ')
|
||||
.visit(Tools.field(TRUNC_TO_MICROS.matcher("" + interval).replaceAll("$1"), SQLDataType.VARCHAR)).sql(' ').visit(K_DAY_MICROSECOND).sql(')');
|
||||
ctx.visit(N_DATE_ADD).sql('(').visit(lhs).sql(", ").visit(K_INTERVAL).sql(' ')
|
||||
.visit(Tools.field(TRUNC_TO_MICROS.matcher("" + interval).replaceAll("$1"), SQLDataType.VARCHAR)).sql(' ').visit(K_DAY_MICROSECOND).sql(')');
|
||||
break;
|
||||
}
|
||||
|
||||
@ -363,12 +363,12 @@ final class Expression<T> extends AbstractField<T> {
|
||||
ctx.visit(K_CAST).sql('(');
|
||||
|
||||
if (rhs.getType() == YearToMonth.class)
|
||||
ctx.sql("{fn ").visit(F_TIMESTAMPADD).sql('(').visit(keyword("sql_tsi_month")).sql(", ")
|
||||
ctx.sql("{fn ").visit(N_TIMESTAMPADD).sql('(').visit(keyword("sql_tsi_month")).sql(", ")
|
||||
.visit(p(sign * rhsAsYTM().intValue())).sql(", ").visit(lhs).sql(") }");
|
||||
else
|
||||
ctx.sql("{fn ").visit(F_TIMESTAMPADD).sql('(').visit(keyword("sql_tsi_second")).sql(", ")
|
||||
ctx.sql("{fn ").visit(N_TIMESTAMPADD).sql('(').visit(keyword("sql_tsi_second")).sql(", ")
|
||||
.visit(p(sign * (long) rhsAsDTS().getTotalSeconds())).sql(", {fn ")
|
||||
.visit(F_TIMESTAMPADD).sql('(').visit(keyword("sql_tsi_milli_second")).sql(", ")
|
||||
.visit(N_TIMESTAMPADD).sql('(').visit(keyword("sql_tsi_milli_second")).sql(", ")
|
||||
.visit(p(sign * (long) rhsAsDTS().getMilli())).sql(", ").visit(lhs).sql(") }) }");
|
||||
|
||||
// [#1883] TIMESTAMPADD returns TIMESTAMP columns. If this
|
||||
@ -383,9 +383,9 @@ final class Expression<T> extends AbstractField<T> {
|
||||
if (rhs.getType() == YearToSecond.class)
|
||||
ctx.visit(getYTSExpression());
|
||||
else if (rhs.getType() == YearToMonth.class)
|
||||
ctx.visit(F_DATEADD).sql('(').visit(K_MONTH).sql(", ").visit(p(sign * rhsAsYTM().intValue())).sql(", ").visit(lhs).sql(')');
|
||||
ctx.visit(N_DATEADD).sql('(').visit(K_MONTH).sql(", ").visit(p(sign * rhsAsYTM().intValue())).sql(", ").visit(lhs).sql(')');
|
||||
else
|
||||
ctx.visit(F_DATEADD).sql('(').visit(K_MILLISECOND).sql(", ").visit(p(sign * (long) rhsAsDTS().getTotalMilli())).sql(", ").visit(lhs).sql(')');
|
||||
ctx.visit(N_DATEADD).sql('(').visit(K_MILLISECOND).sql(", ").visit(p(sign * (long) rhsAsDTS().getTotalMilli())).sql(", ").visit(lhs).sql(')');
|
||||
break;
|
||||
}
|
||||
|
||||
@ -393,9 +393,9 @@ final class Expression<T> extends AbstractField<T> {
|
||||
if (rhs.getType() == YearToSecond.class)
|
||||
ctx.visit(getYTSExpression());
|
||||
else if (rhs.getType() == YearToMonth.class)
|
||||
ctx.visit(F_DATEADD).sql("('month', ").visit(p(sign * rhsAsYTM().intValue())).sql(", ").visit(lhs).sql(')');
|
||||
ctx.visit(N_DATEADD).sql("('month', ").visit(p(sign * rhsAsYTM().intValue())).sql(", ").visit(lhs).sql(')');
|
||||
else
|
||||
ctx.visit(F_DATEADD).sql("('ms', ").visit(p(sign * (long) rhsAsDTS().getTotalMilli())).sql(", ").visit(lhs).sql(')');
|
||||
ctx.visit(N_DATEADD).sql("('ms', ").visit(p(sign * (long) rhsAsDTS().getTotalMilli())).sql(", ").visit(lhs).sql(')');
|
||||
break;
|
||||
}
|
||||
|
||||
@ -412,7 +412,7 @@ final class Expression<T> extends AbstractField<T> {
|
||||
interval = interval.neg();
|
||||
|
||||
interval = interval.concat(inline(ytm ? " months" : " seconds"));
|
||||
ctx.visit(F_STRFTIME).sql("('%Y-%m-%d %H:%M:%f', ").visit(lhs).sql(", ").visit(interval).sql(')');
|
||||
ctx.visit(N_STRFTIME).sql("('%Y-%m-%d %H:%M:%f', ").visit(lhs).sql(", ").visit(interval).sql(')');
|
||||
break;
|
||||
}
|
||||
|
||||
@ -609,9 +609,9 @@ final class Expression<T> extends AbstractField<T> {
|
||||
|
||||
case FIREBIRD: {
|
||||
if (operator == ADD)
|
||||
ctx.visit(F_DATEADD).sql('(').visit(K_DAY).sql(", ").visit(rhsAsNumber()).sql(", ").visit(lhs).sql(')');
|
||||
ctx.visit(N_DATEADD).sql('(').visit(K_DAY).sql(", ").visit(rhsAsNumber()).sql(", ").visit(lhs).sql(')');
|
||||
else
|
||||
ctx.visit(F_DATEADD).sql('(').visit(K_DAY).sql(", ").visit(rhsAsNumber().neg()).sql(", ").visit(lhs).sql(')');
|
||||
ctx.visit(N_DATEADD).sql('(').visit(K_DAY).sql(", ").visit(rhsAsNumber().neg()).sql(", ").visit(lhs).sql(')');
|
||||
break;
|
||||
}
|
||||
|
||||
@ -632,9 +632,9 @@ final class Expression<T> extends AbstractField<T> {
|
||||
ctx.visit(K_CAST).sql('(');
|
||||
|
||||
if (operator == ADD)
|
||||
ctx.sql("{fn ").visit(F_TIMESTAMPADD).sql('(').visit(keyword("sql_tsi_day")).sql(", ").visit(rhsAsNumber()).sql(", ").visit(lhs).sql(") }");
|
||||
ctx.sql("{fn ").visit(N_TIMESTAMPADD).sql('(').visit(keyword("sql_tsi_day")).sql(", ").visit(rhsAsNumber()).sql(", ").visit(lhs).sql(") }");
|
||||
else
|
||||
ctx.sql("{fn ").visit(F_TIMESTAMPADD).sql('(').visit(keyword("sql_tsi_day")).sql(", ").visit(rhsAsNumber().neg()).sql(", ").visit(lhs).sql(") }");
|
||||
ctx.sql("{fn ").visit(N_TIMESTAMPADD).sql('(').visit(keyword("sql_tsi_day")).sql(", ").visit(rhsAsNumber().neg()).sql(", ").visit(lhs).sql(") }");
|
||||
|
||||
// [#1883] TIMESTAMPADD returns TIMESTAMP columns. If this
|
||||
// is a DATE column, cast it to DATE
|
||||
@ -652,9 +652,9 @@ final class Expression<T> extends AbstractField<T> {
|
||||
case MARIADB:
|
||||
case MYSQL: {
|
||||
if (operator == ADD)
|
||||
ctx.visit(F_DATE_ADD).sql('(').visit(lhs).sql(", ").visit(K_INTERVAL).sql(' ').visit(rhsAsNumber()).sql(' ').visit(K_DAY).sql(')');
|
||||
ctx.visit(N_DATE_ADD).sql('(').visit(lhs).sql(", ").visit(K_INTERVAL).sql(' ').visit(rhsAsNumber()).sql(' ').visit(K_DAY).sql(')');
|
||||
else
|
||||
ctx.visit(F_DATE_ADD).sql('(').visit(lhs).sql(", ").visit(K_INTERVAL).sql(' ').visit(rhsAsNumber().neg()).sql(' ').visit(K_DAY).sql(')');
|
||||
ctx.visit(N_DATE_ADD).sql('(').visit(lhs).sql(", ").visit(K_INTERVAL).sql(' ').visit(rhsAsNumber().neg()).sql(' ').visit(K_DAY).sql(')');
|
||||
break;
|
||||
}
|
||||
|
||||
@ -694,9 +694,9 @@ final class Expression<T> extends AbstractField<T> {
|
||||
|
||||
case SQLITE:
|
||||
if (operator == ADD)
|
||||
ctx.visit(F_STRFTIME).sql("('%Y-%m-%d %H:%M:%f', ").visit(lhs).sql(", ").visit(rhsAsNumber().concat(inline(" day"))).sql(')');
|
||||
ctx.visit(N_STRFTIME).sql("('%Y-%m-%d %H:%M:%f', ").visit(lhs).sql(", ").visit(rhsAsNumber().concat(inline(" day"))).sql(')');
|
||||
else
|
||||
ctx.visit(F_STRFTIME).sql("('%Y-%m-%d %H:%M:%f', ").visit(lhs).sql(", ").visit(rhsAsNumber().neg().concat(inline(" day"))).sql(')');
|
||||
ctx.visit(N_STRFTIME).sql("('%Y-%m-%d %H:%M:%f', ").visit(lhs).sql(", ").visit(rhsAsNumber().neg().concat(inline(" day"))).sql(')');
|
||||
break;
|
||||
|
||||
|
||||
|
||||
@ -42,14 +42,6 @@ import static org.jooq.impl.DSL.function;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.keyword;
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.Keywords.F_DATEDIFF;
|
||||
import static org.jooq.impl.Keywords.F_DATEPART;
|
||||
import static org.jooq.impl.Keywords.F_DAYOFWEEK;
|
||||
import static org.jooq.impl.Keywords.F_EXTRACT;
|
||||
import static org.jooq.impl.Keywords.F_STRFTIME;
|
||||
import static org.jooq.impl.Keywords.F_TO_CHAR;
|
||||
import static org.jooq.impl.Keywords.F_TO_NUMBER;
|
||||
import static org.jooq.impl.Keywords.F_TRUNC;
|
||||
import static org.jooq.impl.Keywords.K_DATE;
|
||||
import static org.jooq.impl.Keywords.K_DAY;
|
||||
import static org.jooq.impl.Keywords.K_FROM;
|
||||
@ -59,7 +51,14 @@ import static org.jooq.impl.Keywords.K_MINUTE;
|
||||
import static org.jooq.impl.Keywords.K_MONTH;
|
||||
import static org.jooq.impl.Keywords.K_SECOND;
|
||||
import static org.jooq.impl.Keywords.K_YEAR;
|
||||
import static org.jooq.impl.Names.N_DATEDIFF;
|
||||
import static org.jooq.impl.Names.N_DATEPART;
|
||||
import static org.jooq.impl.Names.N_DAYOFWEEK;
|
||||
import static org.jooq.impl.Names.N_EXTRACT;
|
||||
import static org.jooq.impl.Names.N_STRFTIME;
|
||||
import static org.jooq.impl.Names.N_TO_CHAR;
|
||||
import static org.jooq.impl.Names.N_TO_NUMBER;
|
||||
import static org.jooq.impl.Names.N_TRUNC;
|
||||
import static org.jooq.impl.SQLDataType.INTEGER;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
import static org.jooq.impl.Tools.castIfNeeded;
|
||||
@ -95,36 +94,36 @@ final class Extract extends AbstractField<Integer> {
|
||||
case SQLITE:
|
||||
switch (datePart) {
|
||||
case YEAR:
|
||||
ctx.visit(F_STRFTIME).sql("('%Y', ").visit(field).sql(')');
|
||||
ctx.visit(N_STRFTIME).sql("('%Y', ").visit(field).sql(')');
|
||||
return;
|
||||
case MONTH:
|
||||
ctx.visit(F_STRFTIME).sql("('%m', ").visit(field).sql(')');
|
||||
ctx.visit(N_STRFTIME).sql("('%m', ").visit(field).sql(')');
|
||||
return;
|
||||
case DAY:
|
||||
ctx.visit(F_STRFTIME).sql("('%d', ").visit(field).sql(')');
|
||||
ctx.visit(N_STRFTIME).sql("('%d', ").visit(field).sql(')');
|
||||
return;
|
||||
case HOUR:
|
||||
ctx.visit(F_STRFTIME).sql("('%H', ").visit(field).sql(')');
|
||||
ctx.visit(N_STRFTIME).sql("('%H', ").visit(field).sql(')');
|
||||
return;
|
||||
case MINUTE:
|
||||
ctx.visit(F_STRFTIME).sql("('%M', ").visit(field).sql(')');
|
||||
ctx.visit(N_STRFTIME).sql("('%M', ").visit(field).sql(')');
|
||||
return;
|
||||
case SECOND:
|
||||
ctx.visit(F_STRFTIME).sql("('%S', ").visit(field).sql(')');
|
||||
ctx.visit(N_STRFTIME).sql("('%S', ").visit(field).sql(')');
|
||||
return;
|
||||
|
||||
// See: https://www.sqlite.org/lang_datefunc.html
|
||||
case EPOCH:
|
||||
ctx.visit(F_STRFTIME).sql("('%s', ").visit(field).sql(')');
|
||||
ctx.visit(N_STRFTIME).sql("('%s', ").visit(field).sql(')');
|
||||
return;
|
||||
case ISO_DAY_OF_WEEK:
|
||||
ctx.visit(dowSun0ToISO(function("strftime", INTEGER, inline("%w"), field)));
|
||||
return;
|
||||
case DAY_OF_WEEK:
|
||||
ctx.visit(F_STRFTIME).sql("('%w', ").visit(field).sql(") + ").visit(one());
|
||||
ctx.visit(N_STRFTIME).sql("('%w', ").visit(field).sql(") + ").visit(one());
|
||||
return;
|
||||
case DAY_OF_YEAR:
|
||||
ctx.visit(F_STRFTIME).sql("('%j', ").visit(field).sql(')');
|
||||
ctx.visit(N_STRFTIME).sql("('%j', ").visit(field).sql(')');
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -298,7 +297,7 @@ final class Extract extends AbstractField<Integer> {
|
||||
case MYSQL:
|
||||
switch (datePart) {
|
||||
case DAY_OF_WEEK:
|
||||
ctx.visit(F_DAYOFWEEK).sql('(').visit(field).sql(')');
|
||||
ctx.visit(N_DAYOFWEEK).sql('(').visit(field).sql(')');
|
||||
return;
|
||||
case DAY_OF_YEAR:
|
||||
ctx.visit(keyword("dayofyear")).sql('(').visit(field).sql(')');
|
||||
@ -433,6 +432,6 @@ final class Extract extends AbstractField<Integer> {
|
||||
}
|
||||
|
||||
private final void acceptNativeFunction(Context<?> ctx, Keyword keyword) {
|
||||
ctx.visit(F_EXTRACT).sql('(').visit(keyword).sql(' ').visit(K_FROM).sql(' ').visit(field).sql(')');
|
||||
ctx.visit(N_EXTRACT).sql('(').visit(keyword).sql(' ').visit(K_FROM).sql(' ').visit(field).sql(')');
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_FLOOR;
|
||||
import static org.jooq.impl.Names.N_FLOOR;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -76,7 +75,7 @@ final class Floor<T extends Number> extends AbstractField<T> {
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_FLOOR).sql('(').visit(argument).sql(')');
|
||||
ctx.visit(N_FLOOR).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_IIF;
|
||||
import static org.jooq.impl.Names.N_IIF;
|
||||
|
||||
import org.jooq.Condition;
|
||||
|
||||
@ -413,112 +413,5 @@ final class Keywords {
|
||||
static final Keyword K_YEAR_TO_MONTH = keyword("year to month");
|
||||
static final Keyword K_YEAR_TO_FRACTION = keyword("year to fraction");
|
||||
|
||||
static final Keyword F_ACOS = keyword("acos");
|
||||
static final Keyword F_ADD_MONTHS = keyword("add_months");
|
||||
static final Keyword F_ASC = keyword("asc");
|
||||
static final Keyword F_ASCII = keyword("ascii");
|
||||
static final Keyword F_ASCII_VAL = keyword("ascii_val");
|
||||
static final Keyword F_ASIN = keyword("asin");
|
||||
static final Keyword F_ATAN = keyword("atan");
|
||||
static final Keyword F_ATN = keyword("atn");
|
||||
static final Keyword F_BIT_COUNT = keyword("bit_count");
|
||||
static final Keyword F_CEIL = keyword("ceil");
|
||||
static final Keyword F_CEILING = keyword("ceiling");
|
||||
static final Keyword F_CHARINDEX = keyword("charindex");
|
||||
static final Keyword F_CLNG = keyword("clng");
|
||||
static final Keyword F_CONCAT = keyword("concat");
|
||||
static final Keyword F_CONVERT = keyword("convert");
|
||||
static final Keyword F_COSH = keyword("cosh");
|
||||
static final Keyword F_COT = keyword("cot");
|
||||
static final Keyword F_COUNTSET = keyword("countset");
|
||||
static final Keyword F_CURRENT_BIGDATETIME = keyword("current_bigdatetime");
|
||||
static final Keyword F_CURRENT_DATE = keyword("current_date");
|
||||
static final Keyword F_CURRENT_TIME = keyword("current_time");
|
||||
static final Keyword F_CURRENT_TIMESTAMP = keyword("current_timestamp");
|
||||
static final Keyword F_CURRENT_USER = keyword("current_user");
|
||||
static final Keyword F_CURRENTUSER = keyword("currentuser");
|
||||
static final Keyword F_DATE_ADD = keyword("date_add");
|
||||
static final Keyword F_DATE_DIFF = keyword("date_diff");
|
||||
static final Keyword F_DATE_TRUNC = keyword("date_trunc");
|
||||
static final Keyword F_DATEADD = keyword("dateadd");
|
||||
static final Keyword F_DATEDIFF = keyword("datediff");
|
||||
static final Keyword F_DATEPART = keyword("datepart");
|
||||
static final Keyword F_DAYOFWEEK = keyword("dayofweek");
|
||||
static final Keyword F_DAYS_BETWEEN = keyword("days_between");
|
||||
static final Keyword F_DEGREES = keyword("degrees");
|
||||
static final Keyword F_EXTRACT = keyword("extract");
|
||||
static final Keyword F_FLOOR = keyword("floor");
|
||||
static final Keyword F_GEN_ID = keyword("gen_id");
|
||||
static final Keyword F_HASHBYTES = keyword("hashbytes");
|
||||
static final Keyword F_HEX = keyword("hex");
|
||||
static final Keyword F_IFNULL = keyword("ifnull");
|
||||
static final Keyword F_IIF = keyword("iif");
|
||||
static final Keyword F_INSTR = keyword("instr");
|
||||
static final Keyword F_LCASE = keyword("lcase");
|
||||
static final Keyword F_LEFT = keyword("left");
|
||||
static final Keyword F_LEN = keyword("len");
|
||||
static final Keyword F_LENGTH = keyword("length");
|
||||
static final Keyword F_LOCATE = keyword("locate");
|
||||
static final Keyword F_LOWER = keyword("lower");
|
||||
static final Keyword F_LPAD = keyword("lpad");
|
||||
static final Keyword F_LTRIM = keyword("ltrim");
|
||||
static final Keyword F_MD5 = keyword("md5");
|
||||
static final Keyword F_MID = keyword("mid");
|
||||
static final Keyword F_NOW = keyword("now");
|
||||
static final Keyword F_NULLIF = keyword("nullif");
|
||||
static final Keyword F_NUMTODSINTERVAL = keyword("numtodsinterval");
|
||||
static final Keyword F_NVL = keyword("nvl");
|
||||
static final Keyword F_NVL2 = keyword("nvl2");
|
||||
static final Keyword F_OVERLAY = keyword("overlay");
|
||||
static final Keyword F_POSITION = keyword("position");
|
||||
static final Keyword F_POWER = keyword("power");
|
||||
static final Keyword F_RAND = keyword("rand");
|
||||
static final Keyword F_RANDOM = keyword("random");
|
||||
static final Keyword F_RATIO_TO_REPORT = keyword("ratio_to_report");
|
||||
static final Keyword F_RAWTOHEX = keyword("rawtohex");
|
||||
static final Keyword F_REPEAT = keyword("repeat");
|
||||
static final Keyword F_REPLACE = keyword("replace");
|
||||
static final Keyword F_REPLICATE = keyword("replicate");
|
||||
static final Keyword F_REVERSE = keyword("reverse");
|
||||
static final Keyword F_RIGHT = keyword("right");
|
||||
static final Keyword F_RND = keyword("rnd");
|
||||
static final Keyword F_ROLLUP = keyword("rollup");
|
||||
static final Keyword F_ROUND = keyword("round");
|
||||
static final Keyword F_ROUND_DOWN = keyword("round_down");
|
||||
static final Keyword F_RPAD = keyword("rpad");
|
||||
static final Keyword F_RTRIM = keyword("rtrim");
|
||||
static final Keyword F_SCHEMA_NAME = keyword("schema_name");
|
||||
static final Keyword F_SGN = keyword("sgn");
|
||||
static final Keyword F_SIGN = keyword("sign");
|
||||
static final Keyword F_SINH = keyword("sinh");
|
||||
static final Keyword F_SPACE = keyword("space");
|
||||
static final Keyword F_SQR = keyword("sqr");
|
||||
static final Keyword F_SQRT = keyword("sqrt");
|
||||
static final Keyword F_STANDARD_HASH = keyword("standard_hash");
|
||||
static final Keyword F_STRFTIME = keyword("strftime");
|
||||
static final Keyword F_STRREVERSE = keyword("strreverse");
|
||||
static final Keyword F_SUBSTR = keyword("substr");
|
||||
static final Keyword F_SUBSTRING = keyword("substring");
|
||||
static final Keyword F_SYSDATE = keyword("sysdate");
|
||||
static final Keyword F_TANH = keyword("tanh");
|
||||
static final Keyword F_TIMESTAMPADD = keyword("timestampadd");
|
||||
static final Keyword F_TIMESTAMPDIFF = keyword("timestampdiff");
|
||||
static final Keyword F_TO_CHAR = keyword("to_char");
|
||||
static final Keyword F_TO_CLOB = keyword("to_clob");
|
||||
static final Keyword F_TO_DATE = keyword("to_date");
|
||||
static final Keyword F_TO_NUMBER = keyword("to_number");
|
||||
static final Keyword F_TO_TIMESTAMP = keyword("to_timestamp");
|
||||
static final Keyword F_TRIM = keyword("trim");
|
||||
static final Keyword F_TRUNC = keyword("trunc");
|
||||
static final Keyword F_TRUNCNUM = keyword("truncnum");
|
||||
static final Keyword F_TRUNCATE = keyword("truncate");
|
||||
static final Keyword F_UCASE = keyword("ucase");
|
||||
static final Keyword F_UPPER = keyword("upper");
|
||||
static final Keyword F_USER = keyword("user");
|
||||
static final Keyword F_XMLAGG = keyword("xmlagg");
|
||||
static final Keyword F_XMLSERIALIZE = keyword("xmlserialize");
|
||||
static final Keyword F_XMLTEXT = keyword("xmltext");
|
||||
static final Keyword F_ZEROBLOB = keyword("zeroblob");
|
||||
|
||||
private Keywords() {}
|
||||
}
|
||||
|
||||
@ -37,11 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_LTRIM;
|
||||
import static org.jooq.impl.Keywords.F_TRIM;
|
||||
import static org.jooq.impl.Keywords.K_FROM;
|
||||
import static org.jooq.impl.Keywords.K_LEADING;
|
||||
import static org.jooq.impl.Names.N_LTRIM;
|
||||
import static org.jooq.impl.Names.N_TRIM;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -76,11 +75,11 @@ final class LTrim extends AbstractField<String> {
|
||||
if (characters == null) {
|
||||
switch (ctx.family()) {
|
||||
case FIREBIRD:
|
||||
ctx.visit(F_TRIM).sql('(').visit(K_LEADING).sql(' ').visit(K_FROM).sql(' ').visit(argument).sql(')');
|
||||
ctx.visit(N_TRIM).sql('(').visit(K_LEADING).sql(' ').visit(K_FROM).sql(' ').visit(argument).sql(')');
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_LTRIM).sql('(').visit(argument).sql(')');
|
||||
ctx.visit(N_LTRIM).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -92,11 +91,11 @@ final class LTrim extends AbstractField<String> {
|
||||
|
||||
|
||||
case SQLITE:
|
||||
ctx.visit(F_LTRIM).sql('(').visit(argument).sql(", ").visit(characters).sql(')');
|
||||
ctx.visit(N_LTRIM).sql('(').visit(argument).sql(", ").visit(characters).sql(')');
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_TRIM).sql('(').visit(K_LEADING).sql(' ').visit(characters).sql(' ').visit(K_FROM).sql(' ').visit(argument).sql(')');
|
||||
ctx.visit(N_TRIM).sql('(').visit(K_LEADING).sql(' ').visit(characters).sql(' ').visit(K_FROM).sql(' ').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,6 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.Keywords.F_LEFT;
|
||||
import static org.jooq.impl.Names.N_LEFT;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -94,7 +93,7 @@ final class Left extends AbstractField<String> {
|
||||
case MYSQL:
|
||||
case POSTGRES:
|
||||
default:
|
||||
ctx.visit(F_LEFT).sql('(').visit(field).sql(", ").visit(length).sql(')');
|
||||
ctx.visit(N_LEFT).sql('(').visit(field).sql(", ").visit(length).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,18 +52,18 @@ import static org.jooq.SQLDialect.SQLITE;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.impl.Keywords.F_CONCAT;
|
||||
import static org.jooq.impl.Keywords.F_SUBSTR;
|
||||
import static org.jooq.impl.Keywords.F_XMLAGG;
|
||||
import static org.jooq.impl.Keywords.F_XMLSERIALIZE;
|
||||
import static org.jooq.impl.Keywords.F_XMLTEXT;
|
||||
import static org.jooq.impl.Keywords.K_AS;
|
||||
import static org.jooq.impl.Keywords.K_DISTINCT;
|
||||
import static org.jooq.impl.Keywords.K_SEPARATOR;
|
||||
import static org.jooq.impl.Names.N_CONCAT;
|
||||
import static org.jooq.impl.Names.N_GROUP_CONCAT;
|
||||
import static org.jooq.impl.Names.N_LIST;
|
||||
import static org.jooq.impl.Names.N_LISTAGG;
|
||||
import static org.jooq.impl.Names.N_STRING_AGG;
|
||||
import static org.jooq.impl.Names.N_SUBSTR;
|
||||
import static org.jooq.impl.Names.N_XMLAGG;
|
||||
import static org.jooq.impl.Names.N_XMLSERIALIZE;
|
||||
import static org.jooq.impl.Names.N_XMLTEXT;
|
||||
import static org.jooq.impl.Tools.castIfNeeded;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@ -37,8 +37,7 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_LCASE;
|
||||
import static org.jooq.impl.Keywords.F_LOWER;
|
||||
import static org.jooq.impl.Names.N_LCASE;
|
||||
import static org.jooq.impl.Names.N_LOWER;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -71,7 +70,7 @@ final class Lower extends AbstractField<String> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(F_LOWER).sql('(').visit(field).sql(')');
|
||||
ctx.visit(N_LOWER).sql('(').visit(field).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,18 +38,17 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.Keywords.F_HEX;
|
||||
import static org.jooq.impl.Keywords.F_LEN;
|
||||
import static org.jooq.impl.Keywords.F_LENGTH;
|
||||
import static org.jooq.impl.Keywords.F_LPAD;
|
||||
import static org.jooq.impl.Keywords.F_REPLACE;
|
||||
import static org.jooq.impl.Keywords.F_SPACE;
|
||||
import static org.jooq.impl.Keywords.F_SUBSTR;
|
||||
import static org.jooq.impl.Keywords.F_ZEROBLOB;
|
||||
import static org.jooq.impl.Keywords.K_AS;
|
||||
import static org.jooq.impl.Keywords.K_CAST;
|
||||
import static org.jooq.impl.Keywords.K_VARCHAR;
|
||||
import static org.jooq.impl.Names.N_HEX;
|
||||
import static org.jooq.impl.Names.N_LEN;
|
||||
import static org.jooq.impl.Names.N_LENGTH;
|
||||
import static org.jooq.impl.Names.N_LPAD;
|
||||
import static org.jooq.impl.Names.N_REPLACE;
|
||||
import static org.jooq.impl.Names.N_SPACE;
|
||||
import static org.jooq.impl.Names.N_SUBSTR;
|
||||
import static org.jooq.impl.Names.N_ZEROBLOB;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -102,13 +101,13 @@ final class Lpad extends AbstractField<String> {
|
||||
// This beautiful expression was contributed by "Ludo", here:
|
||||
// http://stackoverflow.com/questions/6576343/how-to-simulate-lpad-rpad-with-sqlite
|
||||
case SQLITE: {
|
||||
ctx.visit(F_SUBSTR).sql('(')
|
||||
.visit(F_REPLACE).sql('(')
|
||||
.visit(F_HEX).sql('(')
|
||||
.visit(F_ZEROBLOB).sql('(')
|
||||
ctx.visit(N_SUBSTR).sql('(')
|
||||
.visit(N_REPLACE).sql('(')
|
||||
.visit(N_HEX).sql('(')
|
||||
.visit(N_ZEROBLOB).sql('(')
|
||||
.visit(length)
|
||||
.sql(")), '00', ").visit(character)
|
||||
.sql("), 1, ").visit(length).sql(" - ").visit(F_LENGTH).sql('(').visit(field)
|
||||
.sql("), 1, ").visit(length).sql(" - ").visit(N_LENGTH).sql('(').visit(field)
|
||||
.sql(")) || ").visit(field);
|
||||
break;
|
||||
}
|
||||
@ -116,12 +115,12 @@ final class Lpad extends AbstractField<String> {
|
||||
// According to the Firebird documentation, LPAD outcomes should be
|
||||
// cast to truncate large results...
|
||||
case FIREBIRD: {
|
||||
ctx.visit(K_CAST).sql('(').visit(F_LPAD).sql('(').visit(field).sql(", ").visit(length).sql(", ").visit(character).sql(") ").visit(K_AS).sql(' ').visit(K_VARCHAR).sql("(4000))");
|
||||
ctx.visit(K_CAST).sql('(').visit(N_LPAD).sql('(').visit(field).sql(", ").visit(length).sql(", ").visit(character).sql(") ").visit(K_AS).sql(' ').visit(K_VARCHAR).sql("(4000))");
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
ctx.visit(F_LPAD).sql('(').visit(field).sql(", ").visit(length).sql(", ").visit(character).sql(')');
|
||||
ctx.visit(N_LPAD).sql('(').visit(field).sql(", ").visit(length).sql(", ").visit(character).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,14 +37,13 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_CONVERT;
|
||||
import static org.jooq.impl.Keywords.F_HASHBYTES;
|
||||
import static org.jooq.impl.Keywords.F_LOWER;
|
||||
import static org.jooq.impl.Keywords.F_MD5;
|
||||
import static org.jooq.impl.Keywords.F_RAWTOHEX;
|
||||
import static org.jooq.impl.Keywords.F_STANDARD_HASH;
|
||||
import static org.jooq.impl.Keywords.K_VARCHAR;
|
||||
import static org.jooq.impl.Names.N_CONVERT;
|
||||
import static org.jooq.impl.Names.N_HASHBYTES;
|
||||
import static org.jooq.impl.Names.N_LOWER;
|
||||
import static org.jooq.impl.Names.N_MD5;
|
||||
import static org.jooq.impl.Names.N_RAWTOHEX;
|
||||
import static org.jooq.impl.Names.N_STANDARD_HASH;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -105,7 +104,7 @@ final class MD5 extends AbstractField<String> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(F_MD5).sql('(').visit(argument).sql(')');
|
||||
ctx.visit(N_MD5).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,6 +37,9 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.impl.DSL.unquotedName;
|
||||
|
||||
import org.jooq.Name;
|
||||
|
||||
/**
|
||||
@ -46,131 +49,190 @@ import org.jooq.Name;
|
||||
*/
|
||||
final class Names {
|
||||
|
||||
static final Name N_ARRAY_TABLE = DSL.name("array_table");
|
||||
static final Name N_COLUMN_VALUE = DSL.name("COLUMN_VALUE");
|
||||
static final Name N_ARRAY_TABLE = name("array_table");
|
||||
static final Name N_COLUMN_VALUE = name("COLUMN_VALUE");
|
||||
|
||||
static final Name N_ACOS = unquotedName("acos");
|
||||
static final Name N_ADD_MONTHS = unquotedName("add_months");
|
||||
static final Name N_ARRAY = unquotedName("array");
|
||||
static final Name N_ARRAY_AGG = unquotedName("array_agg");
|
||||
static final Name N_ASC = unquotedName("asc");
|
||||
static final Name N_ASCII = unquotedName("ascii");
|
||||
static final Name N_ASCII_VAL = unquotedName("ascii_val");
|
||||
static final Name N_ASIN = unquotedName("asin");
|
||||
static final Name N_ATAN = unquotedName("atan");
|
||||
static final Name N_ATN = unquotedName("atn");
|
||||
static final Name N_BIT_COUNT = unquotedName("bit_count");
|
||||
static final Name N_BOOL_AND = unquotedName("bool_and");
|
||||
static final Name N_BOOL_OR = unquotedName("bool_or");
|
||||
static final Name N_CASE = unquotedName("case");
|
||||
static final Name N_CAST = unquotedName("cast");
|
||||
static final Name N_CEIL = unquotedName("ceil");
|
||||
static final Name N_CEILING = unquotedName("ceiling");
|
||||
static final Name N_CHARINDEX = unquotedName("charindex");
|
||||
static final Name N_CHOOSE = unquotedName("choose");
|
||||
static final Name N_CLNG = unquotedName("clng");
|
||||
static final Name N_COALESCE = unquotedName("coalesce");
|
||||
static final Name N_COLLECT = unquotedName("collect");
|
||||
static final Name N_CONCAT = unquotedName("concat");
|
||||
static final Name N_CONVERT = unquotedName("convert");
|
||||
static final Name N_COSH = unquotedName("cosh");
|
||||
static final Name N_COT = unquotedName("cot");
|
||||
static final Name N_COUNTSET = unquotedName("countset");
|
||||
static final Name N_CURRENT_BIGDATETIME = unquotedName("current_bigdatetime");
|
||||
static final Name N_CURRENT_DATE = unquotedName("current_date");
|
||||
static final Name N_CURRENT_SCHEMA = unquotedName("current_schema");
|
||||
static final Name N_CURRENT_TIME = unquotedName("current_time");
|
||||
static final Name N_CURRENT_TIMESTAMP = unquotedName("current_timestamp");
|
||||
static final Name N_CURRENT_USER = unquotedName("current_user");
|
||||
static final Name N_CURRENTUSER = unquotedName("currentuser");
|
||||
static final Name N_CURRVAL = unquotedName("currval");
|
||||
static final Name N_DATE_ADD = unquotedName("date_add");
|
||||
static final Name N_DATE_DIFF = unquotedName("date_diff");
|
||||
static final Name N_DATE_TRUNC = unquotedName("date_trunc");
|
||||
static final Name N_DATEADD = unquotedName("dateadd");
|
||||
static final Name N_DATEDIFF = unquotedName("datediff");
|
||||
static final Name N_DATEPART = unquotedName("datepart");
|
||||
static final Name N_DAYOFWEEK = unquotedName("dayofweek");
|
||||
static final Name N_DAYS_BETWEEN = unquotedName("days_between");
|
||||
static final Name N_DECODE = unquotedName("decode");
|
||||
static final Name N_DEGREES = unquotedName("degrees");
|
||||
static final Name N_DUAL = unquotedName("dual");
|
||||
static final Name N_E = unquotedName("e");
|
||||
static final Name N_EXP = unquotedName("exp");
|
||||
static final Name N_EXTRACT = unquotedName("extract");
|
||||
static final Name N_FLASHBACK = unquotedName("flashback");
|
||||
static final Name N_FLOOR = unquotedName("floor");
|
||||
static final Name N_FUNCTION = unquotedName("function");
|
||||
static final Name N_GEN_ID = unquotedName("gen_id");
|
||||
static final Name N_GENERATE_SERIES = unquotedName("generate_series");
|
||||
static final Name N_GREATEST = unquotedName("greatest");
|
||||
static final Name N_GROUP_CONCAT = unquotedName("group_concat");
|
||||
static final Name N_HASHBYTES = unquotedName("hashbytes");
|
||||
static final Name N_HEX = unquotedName("hex");
|
||||
static final Name N_IFNULL = unquotedName("ifnull");
|
||||
static final Name N_IIF = unquotedName("iif");
|
||||
static final Name N_INSTR = unquotedName("instr");
|
||||
static final Name N_JOIN = unquotedName("join");
|
||||
static final Name N_JSON_AGG = unquotedName("json_agg");
|
||||
static final Name N_JSON_ARRAY = unquotedName("json_array");
|
||||
static final Name N_JSON_ARRAYAGG = unquotedName("json_arrayagg");
|
||||
static final Name N_JSON_CONTAINS_PATH = unquotedName("json_contains_path");
|
||||
static final Name N_JSON_EXTRACT = unquotedName("json_extract");
|
||||
static final Name N_JSON_OBJECT = unquotedName("json_object");
|
||||
static final Name N_JSON_OBJECT_AGG = unquotedName("json_object_agg");
|
||||
static final Name N_JSON_OBJECTAGG = unquotedName("json_objectagg");
|
||||
static final Name N_JSON_VALUE = unquotedName("json_value");
|
||||
static final Name N_JSONB_AGG = unquotedName("jsonb_agg");
|
||||
static final Name N_JSONB_OBJECT = unquotedName("jsonb_object");
|
||||
static final Name N_JSONB_OBJECT_AGG = unquotedName("jsonb_object_agg");
|
||||
static final Name N_JSONB_OBJECTAGG = unquotedName("jsonb_objectagg");
|
||||
static final Name N_JSONB_PATH_EXISTS = unquotedName("jsonb_path_exists");
|
||||
static final Name N_JSONB_PATH_QUERY_FIRST = unquotedName("jsonb_path_query_first");
|
||||
static final Name N_LCASE = unquotedName("lcase");
|
||||
static final Name N_LEAST = unquotedName("least");
|
||||
static final Name N_LEFT = unquotedName("left");
|
||||
static final Name N_LEN = unquotedName("len");
|
||||
static final Name N_LENGTH = unquotedName("length");
|
||||
static final Name N_LIST = unquotedName("list");
|
||||
static final Name N_LISTAGG = unquotedName("listagg");
|
||||
static final Name N_LN = unquotedName("ln");
|
||||
static final Name N_LOCATE = unquotedName("locate");
|
||||
static final Name N_LOWER = unquotedName("lower");
|
||||
static final Name N_LPAD = unquotedName("lpad");
|
||||
static final Name N_LTRIM = unquotedName("ltrim");
|
||||
static final Name N_MD5 = unquotedName("md5");
|
||||
static final Name N_MEDIAN = unquotedName("median");
|
||||
static final Name N_MID = unquotedName("mid");
|
||||
static final Name N_MOD = unquotedName("mod");
|
||||
static final Name N_MODE = unquotedName("mode");
|
||||
static final Name N_NEXTVAL = unquotedName("nextval");
|
||||
static final Name N_NOT = unquotedName("not");
|
||||
static final Name N_NOW = unquotedName("now");
|
||||
static final Name N_NTILE = unquotedName("ntile");
|
||||
static final Name N_NULLIF = unquotedName("nullif");
|
||||
static final Name N_NUMTODSINTERVAL = unquotedName("numtodsinterval");
|
||||
static final Name N_NVL = unquotedName("nvl");
|
||||
static final Name N_NVL2 = unquotedName("nvl2");
|
||||
static final Name N_OVERLAY = unquotedName("overlay");
|
||||
static final Name N_PI = unquotedName("pi");
|
||||
static final Name N_PIVOT = unquotedName("pivot");
|
||||
static final Name N_POSITION = unquotedName("position");
|
||||
static final Name N_POWER = unquotedName("power");
|
||||
static final Name N_PRIOR = unquotedName("prior");
|
||||
static final Name N_PRODUCT = unquotedName("product");
|
||||
static final Name N_RADIANS = unquotedName("radians");
|
||||
static final Name N_RAND = unquotedName("rand");
|
||||
static final Name N_RANDOM = unquotedName("rand");
|
||||
static final Name N_RATIO_TO_REPORT = unquotedName("ratio_to_report");
|
||||
static final Name N_RAWTOHEX = unquotedName("rawtohex");
|
||||
static final Name N_REPEAT = unquotedName("repeat");
|
||||
static final Name N_REPLACE = unquotedName("replace");
|
||||
static final Name N_REPLICATE = unquotedName("replicate");
|
||||
static final Name N_REVERSE = unquotedName("reverse");
|
||||
static final Name N_RIGHT = unquotedName("right");
|
||||
static final Name N_RND = unquotedName("rnd");
|
||||
static final Name N_ROLLUP = unquotedName("rollup");
|
||||
static final Name N_ROUND = unquotedName("round");
|
||||
static final Name N_ROUND_DOWN = unquotedName("round_down");
|
||||
static final Name N_ROW = unquotedName("row");
|
||||
static final Name N_ROW_NUMBER = unquotedName("row_number");
|
||||
static final Name N_ROWNUM = unquotedName("rownum");
|
||||
static final Name N_ROWSFROM = unquotedName("rowsfrom");
|
||||
static final Name N_RPAD = unquotedName("rpad");
|
||||
static final Name N_RTRIM = unquotedName("rtrim");
|
||||
static final Name N_SCHEMA_NAME = unquotedName("schema_name");
|
||||
static final Name N_SELECT = unquotedName("select");
|
||||
static final Name N_SGN = unquotedName("sgn");
|
||||
static final Name N_SIGN = unquotedName("sign");
|
||||
static final Name N_SINH = unquotedName("sinh");
|
||||
static final Name N_SPACE = unquotedName("space");
|
||||
static final Name N_SQR = unquotedName("sqr");
|
||||
static final Name N_SQRT = unquotedName("sqrt");
|
||||
static final Name N_STANDARD_HASH = unquotedName("standard_hash");
|
||||
static final Name N_STATS_MODE = unquotedName("stats_mode");
|
||||
static final Name N_STRFTIME = unquotedName("strftime");
|
||||
static final Name N_STRING_AGG = unquotedName("string_agg");
|
||||
static final Name N_STRREVERSE = unquotedName("strreverse");
|
||||
static final Name N_SUBSTR = unquotedName("substr");
|
||||
static final Name N_SUBSTRING = unquotedName("substring");
|
||||
static final Name N_SYSDATE = unquotedName("sysdate");
|
||||
static final Name N_SYSTEM_TIME = unquotedName("system_time");
|
||||
static final Name N_T = unquotedName("t");
|
||||
static final Name N_TANH = unquotedName("tanh");
|
||||
static final Name N_TIMESTAMPADD = unquotedName("timestampadd");
|
||||
static final Name N_TIMESTAMPDIFF = unquotedName("timestampdiff");
|
||||
static final Name N_TO_CHAR = unquotedName("to_char");
|
||||
static final Name N_TO_CLOB = unquotedName("to_clob");
|
||||
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_TRANSLATE = unquotedName("translate");
|
||||
static final Name N_TRIM = unquotedName("trim");
|
||||
static final Name N_TRUNC = unquotedName("trunc");
|
||||
static final Name N_TRUNCATE = unquotedName("truncate");
|
||||
static final Name N_TRUNCNUM = unquotedName("truncnum");
|
||||
static final Name N_UCASE = unquotedName("ucase");
|
||||
static final Name N_UPPER = unquotedName("upper");
|
||||
static final Name N_USER = unquotedName("user");
|
||||
static final Name N_VALUES = unquotedName("values");
|
||||
static final Name N_WIDTH_BUCKET = unquotedName("width_bucket");
|
||||
static final Name N_XMLAGG = unquotedName("xmlagg");
|
||||
static final Name N_XMLATTRIBUTES = unquotedName("xmlattributes");
|
||||
static final Name N_XMLCOMMENT = unquotedName("xmlcomment");
|
||||
static final Name N_XMLCONCAT = unquotedName("xmlconcat");
|
||||
static final Name N_XMLDOCUMENT = unquotedName("xmldocument");
|
||||
static final Name N_XMLELEMENT = unquotedName("xmlelement");
|
||||
static final Name N_XMLFOREST = unquotedName("xmlforest");
|
||||
static final Name N_XMLPARSE = unquotedName("xmlparse");
|
||||
static final Name N_XMLPI = unquotedName("xmlpi");
|
||||
static final Name N_XMLQUERY = unquotedName("xmlquery");
|
||||
static final Name N_XMLROOT = unquotedName("xmlroot");
|
||||
static final Name N_XMLSERIALIZE = unquotedName("xmlserialize");
|
||||
static final Name N_XMLTABLE = unquotedName("xmltable");
|
||||
static final Name N_XMLTEXT = unquotedName("xmltext");
|
||||
static final Name N_XPATH = unquotedName("xpath");
|
||||
static final Name N_ZEROBLOB = unquotedName("zeroblob");
|
||||
|
||||
static final Name N_ACOS = DSL.unquotedName("acos");
|
||||
static final Name N_ARRAY = DSL.unquotedName("array");
|
||||
static final Name N_ARRAY_AGG = DSL.unquotedName("array_agg");
|
||||
static final Name N_ASCII = DSL.unquotedName("ascii");
|
||||
static final Name N_ASIN = DSL.unquotedName("asin");
|
||||
static final Name N_ATAN = DSL.unquotedName("atan");
|
||||
static final Name N_BIT_COUNT = DSL.unquotedName("bit_count");
|
||||
static final Name N_CASE = DSL.unquotedName("case");
|
||||
static final Name N_CAST = DSL.unquotedName("cast");
|
||||
static final Name N_CEIL = DSL.unquotedName("ceil");
|
||||
static final Name N_CHOOSE = DSL.unquotedName("choose");
|
||||
static final Name N_COALESCE = DSL.unquotedName("coalesce");
|
||||
static final Name N_COLLECT = DSL.unquotedName("collect");
|
||||
static final Name N_CONCAT = DSL.unquotedName("concat");
|
||||
static final Name N_CONVERT = DSL.unquotedName("convert");
|
||||
static final Name N_COSH = DSL.unquotedName("cosh");
|
||||
static final Name N_COT = DSL.unquotedName("cot");
|
||||
static final Name N_CURRENT_DATE = DSL.unquotedName("current_date");
|
||||
static final Name N_CURRENT_SCHEMA = DSL.unquotedName("current_schema");
|
||||
static final Name N_CURRENT_TIME = DSL.unquotedName("current_time");
|
||||
static final Name N_CURRENT_TIMESTAMP = DSL.unquotedName("current_timestamp");
|
||||
static final Name N_CURRENT_USER = DSL.unquotedName("current_user");
|
||||
static final Name N_CURRVAL = DSL.unquotedName("currval");
|
||||
static final Name N_DATEADD = DSL.unquotedName("dateadd");
|
||||
static final Name N_DATEDIFF = DSL.unquotedName("datediff");
|
||||
static final Name N_DECODE = DSL.unquotedName("decode");
|
||||
static final Name N_DEGREES = DSL.unquotedName("degrees");
|
||||
static final Name N_DUAL = DSL.unquotedName("dual");
|
||||
static final Name N_E = DSL.unquotedName("e");
|
||||
static final Name N_EXP = DSL.unquotedName("exp");
|
||||
static final Name N_EXTRACT = DSL.unquotedName("extract");
|
||||
static final Name N_FLASHBACK = DSL.unquotedName("flashback");
|
||||
static final Name N_FLOOR = DSL.unquotedName("floor");
|
||||
static final Name N_FUNCTION = DSL.unquotedName("function");
|
||||
static final Name N_GENERATE_SERIES = DSL.unquotedName("generate_series");
|
||||
static final Name N_GREATEST = DSL.unquotedName("greatest");
|
||||
static final Name N_GROUP_CONCAT = DSL.unquotedName("group_concat");
|
||||
static final Name N_IIF = DSL.unquotedName("iif");
|
||||
static final Name N_JOIN = DSL.unquotedName("join");
|
||||
static final Name N_JSON_AGG = DSL.unquotedName("json_agg");
|
||||
static final Name N_JSON_ARRAY = DSL.unquotedName("json_array");
|
||||
static final Name N_JSON_ARRAYAGG = DSL.unquotedName("json_arrayagg");
|
||||
static final Name N_JSON_CONTAINS_PATH = DSL.unquotedName("json_contains_path");
|
||||
static final Name N_JSON_EXTRACT = DSL.unquotedName("json_extract");
|
||||
static final Name N_JSON_OBJECT = DSL.unquotedName("json_object");
|
||||
static final Name N_JSON_OBJECT_AGG = DSL.unquotedName("json_object_agg");
|
||||
static final Name N_JSON_OBJECTAGG = DSL.unquotedName("json_objectagg");
|
||||
static final Name N_JSON_VALUE = DSL.unquotedName("json_value");
|
||||
static final Name N_JSONB_AGG = DSL.unquotedName("jsonb_agg");
|
||||
static final Name N_JSONB_OBJECT = DSL.unquotedName("jsonb_object");
|
||||
static final Name N_JSONB_OBJECT_AGG = DSL.unquotedName("jsonb_object_agg");
|
||||
static final Name N_JSONB_OBJECTAGG = DSL.unquotedName("jsonb_objectagg");
|
||||
static final Name N_JSONB_PATH_EXISTS = DSL.unquotedName("jsonb_path_exists");
|
||||
static final Name N_JSONB_PATH_QUERY_FIRST = DSL.unquotedName("jsonb_path_query_first");
|
||||
static final Name N_LEAST = DSL.unquotedName("least");
|
||||
static final Name N_LEFT = DSL.unquotedName("left");
|
||||
static final Name N_LIST = DSL.unquotedName("list");
|
||||
static final Name N_LISTAGG = DSL.unquotedName("listagg");
|
||||
static final Name N_LN = DSL.unquotedName("ln");
|
||||
static final Name N_LOWER = DSL.unquotedName("lower");
|
||||
static final Name N_LPAD = DSL.unquotedName("lpad");
|
||||
static final Name N_LTRIM = DSL.unquotedName("ltrim");
|
||||
static final Name N_MD5 = DSL.unquotedName("md5");
|
||||
static final Name N_MEDIAN = DSL.unquotedName("median");
|
||||
static final Name N_MOD = DSL.unquotedName("mod");
|
||||
static final Name N_MODE = DSL.unquotedName("mode");
|
||||
static final Name N_NEXTVAL = DSL.unquotedName("nextval");
|
||||
static final Name N_NOT = DSL.unquotedName("not");
|
||||
static final Name N_NTILE = DSL.unquotedName("ntile");
|
||||
static final Name N_NULLIF = DSL.unquotedName("nullif");
|
||||
static final Name N_NVL = DSL.unquotedName("nvl");
|
||||
static final Name N_NVL2 = DSL.unquotedName("nvl2");
|
||||
static final Name N_OVERLAY = DSL.unquotedName("overlay");
|
||||
static final Name N_PI = DSL.unquotedName("pi");
|
||||
static final Name N_PIVOT = DSL.unquotedName("pivot");
|
||||
static final Name N_POSITION = DSL.unquotedName("position");
|
||||
static final Name N_POWER = DSL.unquotedName("power");
|
||||
static final Name N_PRIOR = DSL.unquotedName("prior");
|
||||
static final Name N_PRODUCT = DSL.unquotedName("product");
|
||||
static final Name N_RADIANS = DSL.unquotedName("radians");
|
||||
static final Name N_RANDOM = DSL.unquotedName("rand");
|
||||
static final Name N_REPLACE = DSL.unquotedName("replace");
|
||||
static final Name N_REVERSE = DSL.unquotedName("reverse");
|
||||
static final Name N_RIGHT = DSL.unquotedName("right");
|
||||
static final Name N_ROLLUP = DSL.unquotedName("rollup");
|
||||
static final Name N_ROUND = DSL.unquotedName("round");
|
||||
static final Name N_ROW = DSL.unquotedName("row");
|
||||
static final Name N_ROW_NUMBER = DSL.unquotedName("row_number");
|
||||
static final Name N_ROWNUM = DSL.unquotedName("rownum");
|
||||
static final Name N_ROWSFROM = DSL.unquotedName("rowsfrom");
|
||||
static final Name N_RPAD = DSL.unquotedName("rpad");
|
||||
static final Name N_RTRIM = DSL.unquotedName("rtrim");
|
||||
static final Name N_SELECT = DSL.unquotedName("select");
|
||||
static final Name N_SIGN = DSL.unquotedName("sign");
|
||||
static final Name N_SINH = DSL.unquotedName("sinh");
|
||||
static final Name N_SPACE = DSL.unquotedName("space");
|
||||
static final Name N_SQRT = DSL.unquotedName("sqrt");
|
||||
static final Name N_STATS_MODE = DSL.unquotedName("stats_mode");
|
||||
static final Name N_STRING_AGG = DSL.unquotedName("string_agg");
|
||||
static final Name N_SUBSTRING = DSL.unquotedName("substring");
|
||||
static final Name N_SYSTEM_TIME = DSL.unquotedName("system_time");
|
||||
static final Name N_T = DSL.unquotedName("t");
|
||||
static final Name N_TANH = DSL.unquotedName("tanh");
|
||||
static final Name N_TIMESTAMPDIFF = DSL.unquotedName("timestampdiff");
|
||||
static final Name N_TRANSLATE = DSL.unquotedName("translate");
|
||||
static final Name N_TRIM = DSL.unquotedName("trim");
|
||||
static final Name N_TRUNC = DSL.unquotedName("trunc");
|
||||
static final Name N_UPPER = DSL.unquotedName("upper");
|
||||
static final Name N_VALUES = DSL.unquotedName("values");
|
||||
static final Name N_WIDTH_BUCKET = DSL.unquotedName("width_bucket");
|
||||
static final Name N_XMLAGG = DSL.unquotedName("xmlagg");
|
||||
static final Name N_XMLATTRIBUTES = DSL.unquotedName("xmlattributes");
|
||||
static final Name N_XMLCOMMENT = DSL.unquotedName("xmlcomment");
|
||||
static final Name N_XMLCONCAT = DSL.unquotedName("xmlconcat");
|
||||
static final Name N_XMLDOCUMENT = DSL.unquotedName("xmldocument");
|
||||
static final Name N_XMLELEMENT = DSL.unquotedName("xmlelement");
|
||||
static final Name N_XMLFOREST = DSL.unquotedName("xmlforest");
|
||||
static final Name N_XMLPARSE = DSL.unquotedName("xmlparse");
|
||||
static final Name N_XMLPI = DSL.unquotedName("xmlpi");
|
||||
static final Name N_XMLQUERY = DSL.unquotedName("xmlquery");
|
||||
static final Name N_XMLROOT = DSL.unquotedName("xmlroot");
|
||||
static final Name N_XMLTABLE = DSL.unquotedName("xmltable");
|
||||
static final Name N_XPATH = DSL.unquotedName("xpath");
|
||||
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ final class Ntile extends AbstractWindowFunction<Integer> implements OrderedWind
|
||||
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
ctx.visit(Names.N_NTILE).sql('(').visit(tiles).sql(')');
|
||||
ctx.visit(N_NTILE).sql('(').visit(tiles).sql(')');
|
||||
acceptOverClause(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,9 +37,8 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_IIF;
|
||||
import static org.jooq.impl.Keywords.F_NULLIF;
|
||||
import static org.jooq.impl.Keywords.K_NULL;
|
||||
import static org.jooq.impl.Names.N_IIF;
|
||||
import static org.jooq.impl.Names.N_NULLIF;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -75,7 +74,7 @@ final class NullIf<T> extends AbstractField<T> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(F_NULLIF).sql('(').visit(arg1).sql(",").visit(arg2).sql(')');
|
||||
ctx.visit(N_NULLIF).sql('(').visit(arg1).sql(",").visit(arg2).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,11 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_IFNULL;
|
||||
import static org.jooq.impl.Keywords.F_IIF;
|
||||
import static org.jooq.impl.Keywords.F_NVL;
|
||||
import static org.jooq.impl.Keywords.K_COALESCE;
|
||||
import static org.jooq.impl.Keywords.K_IS_NULL;
|
||||
import static org.jooq.impl.Names.N_IFNULL;
|
||||
import static org.jooq.impl.Names.N_IIF;
|
||||
import static org.jooq.impl.Names.N_NVL;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -82,7 +81,7 @@ final class Nvl<T> extends AbstractField<T> {
|
||||
|
||||
case H2:
|
||||
case HSQLDB:
|
||||
ctx.visit(F_NVL).sql('(').visit(arg1).sql(", ").visit(arg2).sql(')');
|
||||
ctx.visit(N_NVL).sql('(').visit(arg1).sql(", ").visit(arg2).sql(')');
|
||||
break;
|
||||
|
||||
|
||||
@ -101,7 +100,7 @@ final class Nvl<T> extends AbstractField<T> {
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
case SQLITE:
|
||||
ctx.visit(F_IFNULL).sql('(').visit(arg1).sql(", ").visit(arg2).sql(')');
|
||||
ctx.visit(N_IFNULL).sql('(').visit(arg1).sql(", ").visit(arg2).sql(')');
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_NVL2;
|
||||
import static org.jooq.impl.Names.N_NVL2;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -75,7 +74,7 @@ final class Nvl2<T> extends AbstractField<T> {
|
||||
|
||||
case H2:
|
||||
case HSQLDB:
|
||||
ctx.visit(F_NVL2).sql('(').visit(arg1).sql(", ").visit(arg2).sql(", ").visit(arg3).sql(')');
|
||||
ctx.visit(N_NVL2).sql('(').visit(arg1).sql(", ").visit(arg2).sql(", ").visit(arg3).sql(')');
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@ -59,7 +59,6 @@ import static org.jooq.SQLDialect.SQLITE;
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.Keywords.F_OVERLAY;
|
||||
import static org.jooq.impl.Keywords.K_FOR;
|
||||
import static org.jooq.impl.Keywords.K_FROM;
|
||||
import static org.jooq.impl.Keywords.K_PLACING;
|
||||
@ -116,7 +115,7 @@ final class Overlay extends AbstractField<String> {
|
||||
);
|
||||
}
|
||||
else {
|
||||
ctx.visit(F_OVERLAY).sql('(').visit(in).sql(' ')
|
||||
ctx.visit(N_OVERLAY).sql('(').visit(in).sql(' ')
|
||||
.visit(K_PLACING).sql(' ').visit(placing).sql(' ')
|
||||
.visit(K_FROM).sql(' ').visit(startIndex).sql(' ')
|
||||
.visit(K_FOR).sql(' ').visit(l).sql(')');
|
||||
@ -131,7 +130,7 @@ final class Overlay extends AbstractField<String> {
|
||||
);
|
||||
}
|
||||
else {
|
||||
ctx.visit(F_OVERLAY).sql('(').visit(in).sql(' ')
|
||||
ctx.visit(N_OVERLAY).sql('(').visit(in).sql(' ')
|
||||
.visit(K_PLACING).sql(' ').visit(placing).sql(' ')
|
||||
.visit(K_FROM).sql(' ').visit(startIndex).sql(')');
|
||||
}
|
||||
|
||||
@ -39,11 +39,10 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.Keywords.F_CHARINDEX;
|
||||
import static org.jooq.impl.Keywords.F_INSTR;
|
||||
import static org.jooq.impl.Keywords.F_LOCATE;
|
||||
import static org.jooq.impl.Keywords.F_POSITION;
|
||||
import static org.jooq.impl.Keywords.K_IN;
|
||||
import static org.jooq.impl.Names.N_CHARINDEX;
|
||||
import static org.jooq.impl.Names.N_INSTR;
|
||||
import static org.jooq.impl.Names.N_LOCATE;
|
||||
import static org.jooq.impl.Names.N_POSITION;
|
||||
import static org.jooq.impl.SQLDataType.INTEGER;
|
||||
|
||||
@ -99,7 +98,7 @@ final class Position extends AbstractField<Integer> {
|
||||
|
||||
|
||||
case DERBY:
|
||||
ctx.visit(F_LOCATE).sql('(').visit(search).sql(", ").visit(in).sql(')');
|
||||
ctx.visit(N_LOCATE).sql('(').visit(search).sql(", ").visit(in).sql(')');
|
||||
break;
|
||||
|
||||
|
||||
@ -119,11 +118,11 @@ final class Position extends AbstractField<Integer> {
|
||||
|
||||
|
||||
case SQLITE:
|
||||
ctx.visit(F_INSTR).sql('(').visit(in).sql(", ").visit(search).sql(')');
|
||||
ctx.visit(N_INSTR).sql('(').visit(in).sql(", ").visit(search).sql(')');
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_POSITION).sql('(').visit(search).sql(' ').visit(K_IN).sql(' ').visit(in).sql(')');
|
||||
ctx.visit(N_POSITION).sql('(').visit(search).sql(' ').visit(K_IN).sql(' ').visit(in).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_POWER;
|
||||
import static org.jooq.impl.Names.N_POWER;
|
||||
import static org.jooq.impl.SQLDataType.NUMERIC;
|
||||
|
||||
@ -81,7 +80,7 @@ final class Power extends AbstractField<BigDecimal> {
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_POWER).sql('(').visit(arg1).sql(", ").visit(arg2).sql(')');
|
||||
ctx.visit(N_POWER).sql('(').visit(arg1).sql(", ").visit(arg2).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,11 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_RTRIM;
|
||||
import static org.jooq.impl.Keywords.F_TRIM;
|
||||
import static org.jooq.impl.Keywords.K_FROM;
|
||||
import static org.jooq.impl.Keywords.K_TRAILING;
|
||||
import static org.jooq.impl.Names.N_RTRIM;
|
||||
import static org.jooq.impl.Names.N_TRIM;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -76,11 +75,11 @@ final class RTrim extends AbstractField<String> {
|
||||
if (characters == null) {
|
||||
switch (ctx.family()) {
|
||||
case FIREBIRD:
|
||||
ctx.visit(F_TRIM).sql('(').visit(K_TRAILING).sql(' ').visit(K_FROM).sql(' ').visit(argument).sql(')');
|
||||
ctx.visit(N_TRIM).sql('(').visit(K_TRAILING).sql(' ').visit(K_FROM).sql(' ').visit(argument).sql(')');
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_RTRIM).sql('(').visit(argument).sql(')');
|
||||
ctx.visit(N_RTRIM).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -92,11 +91,11 @@ final class RTrim extends AbstractField<String> {
|
||||
|
||||
|
||||
case SQLITE:
|
||||
ctx.visit(F_RTRIM).sql('(').visit(argument).sql(", ").visit(characters).sql(')');
|
||||
ctx.visit(N_RTRIM).sql('(').visit(argument).sql(", ").visit(characters).sql(')');
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_TRIM).sql('(').visit(K_TRAILING).sql(' ').visit(characters).sql(' ').visit(K_FROM).sql(' ').visit(argument).sql(')');
|
||||
ctx.visit(N_TRIM).sql('(').visit(K_TRAILING).sql(' ').visit(characters).sql(' ').visit(K_FROM).sql(' ').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,13 +37,12 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_RAND;
|
||||
import static org.jooq.impl.Keywords.F_RANDOM;
|
||||
import static org.jooq.impl.Keywords.F_RND;
|
||||
import static org.jooq.impl.Keywords.K_AS;
|
||||
import static org.jooq.impl.Keywords.K_CAST;
|
||||
import static org.jooq.impl.Keywords.K_NUMERIC;
|
||||
import static org.jooq.impl.Names.N_RAND;
|
||||
import static org.jooq.impl.Names.N_RANDOM;
|
||||
import static org.jooq.impl.Names.N_RND;
|
||||
import static org.jooq.impl.SQLDataType.NUMERIC;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -97,10 +96,10 @@ final class Rand extends AbstractField<BigDecimal> {
|
||||
case DERBY:
|
||||
case POSTGRES:
|
||||
case SQLITE:
|
||||
ctx.visit(F_RANDOM).sql("()");
|
||||
ctx.visit(N_RANDOM).sql("()");
|
||||
break;
|
||||
default:
|
||||
ctx.visit(F_RAND).sql("()");
|
||||
ctx.visit(N_RAND).sql("()");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.SQLDialect.SQLITE;
|
||||
import static org.jooq.impl.Keywords.F_RATIO_TO_REPORT;
|
||||
import static org.jooq.impl.Names.N_RATIO_TO_REPORT;
|
||||
import static org.jooq.impl.SQLDataType.DECIMAL;
|
||||
import static org.jooq.impl.SQLDataType.DOUBLE;
|
||||
import static org.jooq.impl.Tools.castIfNeeded;
|
||||
@ -61,7 +61,7 @@ final class RatioToReport extends DefaultAggregateFunction<BigDecimal> {
|
||||
private final Field<? extends Number> field;
|
||||
|
||||
RatioToReport(Field<? extends Number> field) {
|
||||
super("ratio_to_report", DECIMAL, field);
|
||||
super(N_RATIO_TO_REPORT, DECIMAL, field);
|
||||
|
||||
this.field = field;
|
||||
}
|
||||
@ -80,7 +80,7 @@ final class RatioToReport extends DefaultAggregateFunction<BigDecimal> {
|
||||
|
||||
|
||||
case H2:
|
||||
ctx.visit(F_RATIO_TO_REPORT).sql('(').visit(field).sql(')');
|
||||
ctx.visit(N_RATIO_TO_REPORT).sql('(').visit(field).sql(')');
|
||||
acceptOverClause(ctx);
|
||||
break;
|
||||
|
||||
|
||||
@ -37,12 +37,12 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_HEX;
|
||||
import static org.jooq.impl.Keywords.F_REPEAT;
|
||||
import static org.jooq.impl.Keywords.F_REPLACE;
|
||||
import static org.jooq.impl.Keywords.F_REPLICATE;
|
||||
import static org.jooq.impl.Keywords.F_ZEROBLOB;
|
||||
import static org.jooq.impl.Names.N_HEX;
|
||||
import static org.jooq.impl.Names.N_REPEAT;
|
||||
import static org.jooq.impl.Names.N_REPLACE;
|
||||
import static org.jooq.impl.Names.N_REPLICATE;
|
||||
import static org.jooq.impl.Names.N_RPAD;
|
||||
import static org.jooq.impl.Names.N_ZEROBLOB;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -88,7 +88,7 @@ final class Repeat extends AbstractField<String> {
|
||||
// Another option is documented here, though:
|
||||
// https://stackoverflow.com/a/51792334/521799
|
||||
case SQLITE:
|
||||
ctx.visit(F_REPLACE).sql('(').visit(F_HEX).sql('(').visit(F_ZEROBLOB).sql('(').visit(count).sql(")), '00', ").visit(string).sql(')');
|
||||
ctx.visit(N_REPLACE).sql('(').visit(N_HEX).sql('(').visit(N_ZEROBLOB).sql('(').visit(count).sql(")), '00', ").visit(string).sql(')');
|
||||
break;
|
||||
|
||||
|
||||
@ -100,7 +100,7 @@ final class Repeat extends AbstractField<String> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(F_REPEAT).sql('(').visit(string).sql(", ").visit(count).sql(')');
|
||||
ctx.visit(N_REPEAT).sql('(').visit(string).sql(", ").visit(count).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,9 +37,8 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_REVERSE;
|
||||
import static org.jooq.impl.Keywords.F_STRREVERSE;
|
||||
import static org.jooq.impl.Names.N_REVERSE;
|
||||
import static org.jooq.impl.Names.N_STRREVERSE;
|
||||
|
||||
import org.jooq.Context;
|
||||
import org.jooq.Field;
|
||||
@ -85,7 +84,7 @@ final class Reverse extends AbstractField<String> {
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
default:
|
||||
ctx.visit(F_REVERSE).sql('(').visit(field).sql(')');
|
||||
ctx.visit(N_REVERSE).sql('(').visit(field).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,6 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.Keywords.F_RIGHT;
|
||||
import static org.jooq.impl.Names.N_RIGHT;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -97,7 +96,7 @@ final class Right extends AbstractField<String> {
|
||||
case MYSQL:
|
||||
case POSTGRES:
|
||||
default:
|
||||
ctx.visit(F_RIGHT).sql('(').visit(field).sql(", ").visit(length).sql(')');
|
||||
ctx.visit(N_RIGHT).sql('(').visit(field).sql(", ").visit(length).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_ROLLUP;
|
||||
import static org.jooq.impl.Keywords.K_WITH_ROLLUP;
|
||||
import static org.jooq.impl.Names.N_ROLLUP;
|
||||
import static org.jooq.impl.SQLDataType.OTHER;
|
||||
@ -75,7 +74,7 @@ final class Rollup extends AbstractField<Object> {
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_ROLLUP).sql('(').visit(arguments).sql(')');
|
||||
ctx.visit(N_ROLLUP).sql('(').visit(arguments).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,18 +38,17 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.Keywords.F_HEX;
|
||||
import static org.jooq.impl.Keywords.F_LEN;
|
||||
import static org.jooq.impl.Keywords.F_LENGTH;
|
||||
import static org.jooq.impl.Keywords.F_REPLACE;
|
||||
import static org.jooq.impl.Keywords.F_RPAD;
|
||||
import static org.jooq.impl.Keywords.F_SPACE;
|
||||
import static org.jooq.impl.Keywords.F_SUBSTR;
|
||||
import static org.jooq.impl.Keywords.F_ZEROBLOB;
|
||||
import static org.jooq.impl.Keywords.K_AS;
|
||||
import static org.jooq.impl.Keywords.K_CAST;
|
||||
import static org.jooq.impl.Keywords.K_VARCHAR;
|
||||
import static org.jooq.impl.Names.N_HEX;
|
||||
import static org.jooq.impl.Names.N_LEN;
|
||||
import static org.jooq.impl.Names.N_LENGTH;
|
||||
import static org.jooq.impl.Names.N_REPLACE;
|
||||
import static org.jooq.impl.Names.N_RPAD;
|
||||
import static org.jooq.impl.Names.N_SPACE;
|
||||
import static org.jooq.impl.Names.N_SUBSTR;
|
||||
import static org.jooq.impl.Names.N_ZEROBLOB;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -100,24 +99,24 @@ final class Rpad extends AbstractField<String> {
|
||||
// This beautiful expression was contributed by "Ludo", here:
|
||||
// http://stackoverflow.com/questions/6576343/how-to-simulate-lpad-rpad-with-sqlite
|
||||
case SQLITE:
|
||||
ctx.visit(field).sql(" || ").visit(F_SUBSTR).sql('(')
|
||||
.visit(F_REPLACE).sql('(')
|
||||
.visit(F_HEX).sql('(')
|
||||
.visit(F_ZEROBLOB).sql('(')
|
||||
ctx.visit(field).sql(" || ").visit(N_SUBSTR).sql('(')
|
||||
.visit(N_REPLACE).sql('(')
|
||||
.visit(N_HEX).sql('(')
|
||||
.visit(N_ZEROBLOB).sql('(')
|
||||
.visit(length)
|
||||
.sql(")), '00', ").visit(character)
|
||||
.sql("), 1, ").visit(length).sql(" - ").visit(F_LENGTH).sql('(').visit(field).sql(')')
|
||||
.sql("), 1, ").visit(length).sql(" - ").visit(N_LENGTH).sql('(').visit(field).sql(')')
|
||||
.sql(')');
|
||||
break;
|
||||
|
||||
// According to the Firebird documentation, RPAD outcomes should be
|
||||
// cast to truncate large results...
|
||||
case FIREBIRD:
|
||||
ctx.visit(K_CAST).sql('(').visit(F_RPAD).sql('(').visit(field).sql(", ").visit(length).sql(", ").visit(character).sql(") ").visit(K_AS).sql(' ').visit(K_VARCHAR).sql("(4000))");
|
||||
ctx.visit(K_CAST).sql('(').visit(N_RPAD).sql('(').visit(field).sql(", ").visit(length).sql(", ").visit(character).sql(") ").visit(K_AS).sql(' ').visit(K_VARCHAR).sql("(4000))");
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_RPAD).sql('(').visit(field).sql(", ").visit(length).sql(", ").visit(character).sql(')');
|
||||
ctx.visit(N_RPAD).sql('(').visit(field).sql(", ").visit(length).sql(", ").visit(character).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,13 +46,13 @@ import static org.jooq.SQLDialect.HSQLDB;
|
||||
import static org.jooq.SQLDialect.MARIADB;
|
||||
// ...
|
||||
import static org.jooq.impl.DSL.select;
|
||||
import static org.jooq.impl.Keywords.F_GEN_ID;
|
||||
import static org.jooq.impl.Keywords.K_CURRENT_VALUE_FOR;
|
||||
import static org.jooq.impl.Keywords.K_CURRVAL;
|
||||
import static org.jooq.impl.Keywords.K_NEXTVAL;
|
||||
import static org.jooq.impl.Keywords.K_NEXT_VALUE_FOR;
|
||||
import static org.jooq.impl.Keywords.K_PREVIOUS_VALUE_FOR;
|
||||
import static org.jooq.impl.Names.N_CURRVAL;
|
||||
import static org.jooq.impl.Names.N_GEN_ID;
|
||||
import static org.jooq.impl.Names.N_NEXTVAL;
|
||||
|
||||
import org.jooq.Catalog;
|
||||
@ -250,7 +250,7 @@ public class SequenceImpl<T extends Number> extends AbstractTypedNamed<T> implem
|
||||
else if (family == MARIADB)
|
||||
ctx.visit(K_PREVIOUS_VALUE_FOR).sql(' ').visit(SequenceImpl.this);
|
||||
else if (family == FIREBIRD)
|
||||
ctx.visit(F_GEN_ID).sql('(').visit(SequenceImpl.this).sql(", 0)");
|
||||
ctx.visit(N_GEN_ID).sql('(').visit(SequenceImpl.this).sql(", 0)");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -39,8 +39,7 @@ package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.DSL.zero;
|
||||
import static org.jooq.impl.Keywords.F_SGN;
|
||||
import static org.jooq.impl.Keywords.F_SIGN;
|
||||
import static org.jooq.impl.Names.N_SGN;
|
||||
import static org.jooq.impl.Names.N_SIGN;
|
||||
import static org.jooq.impl.SQLDataType.INTEGER;
|
||||
|
||||
@ -83,7 +82,7 @@ final class Sign extends AbstractField<Integer> {
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_SIGN).sql('(').visit(argument).sql(')');
|
||||
ctx.visit(N_SIGN).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,6 @@ package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.DSL.two;
|
||||
import static org.jooq.impl.Keywords.F_SINH;
|
||||
import static org.jooq.impl.Names.N_SINH;
|
||||
import static org.jooq.impl.SQLDataType.NUMERIC;
|
||||
|
||||
@ -92,7 +91,7 @@ final class Sinh extends AbstractField<BigDecimal> {
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_SINH).sql('(').visit(argument).sql(')');
|
||||
ctx.visit(N_SINH).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_SPACE;
|
||||
import static org.jooq.impl.Names.N_SPACE;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
|
||||
@ -97,7 +96,7 @@ final class Space extends AbstractField<String> {
|
||||
case MYSQL:
|
||||
case H2:
|
||||
default:
|
||||
ctx.visit(F_SPACE).sql('(').visit(count).sql(')');
|
||||
ctx.visit(N_SPACE).sql('(').visit(count).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,8 +37,7 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_SQR;
|
||||
import static org.jooq.impl.Keywords.F_SQRT;
|
||||
import static org.jooq.impl.Names.N_SQR;
|
||||
import static org.jooq.impl.Names.N_SQRT;
|
||||
import static org.jooq.impl.SQLDataType.NUMERIC;
|
||||
|
||||
@ -88,7 +87,7 @@ final class Sqrt extends AbstractField<BigDecimal> {
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_SQRT).sql('(').visit(argument).sql(')');
|
||||
ctx.visit(N_SQRT).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,17 +38,16 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.Keywords.F_MID;
|
||||
import static org.jooq.impl.Keywords.F_SUBSTR;
|
||||
import static org.jooq.impl.Keywords.F_SUBSTRING;
|
||||
import static org.jooq.impl.Keywords.K_FOR;
|
||||
import static org.jooq.impl.Keywords.K_FROM;
|
||||
import static org.jooq.impl.Names.N_MID;
|
||||
import static org.jooq.impl.Names.N_SUBSTR;
|
||||
import static org.jooq.impl.Names.N_SUBSTRING;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
|
||||
import org.jooq.Context;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Keyword;
|
||||
import org.jooq.Name;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
@ -78,7 +77,7 @@ final class Substring extends AbstractField<String> {
|
||||
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
Keyword functionName = F_SUBSTRING;
|
||||
Name functionName = N_SUBSTRING;
|
||||
|
||||
switch (ctx.family()) {
|
||||
|
||||
@ -88,9 +87,10 @@ final class Substring extends AbstractField<String> {
|
||||
|
||||
case FIREBIRD: {
|
||||
if (length == null)
|
||||
ctx.visit(F_SUBSTRING).sql('(').visit(field).sql(' ').visit(K_FROM).sql(' ').visit(startingPosition).sql(')');
|
||||
ctx.visit(N_SUBSTRING).sql('(').visit(field).sql(' ').visit(K_FROM).sql(' ').visit(startingPosition).sql(')');
|
||||
else
|
||||
ctx.visit(F_SUBSTRING).sql('(').visit(field).sql(' ').visit(K_FROM).sql(' ').visit(startingPosition).sql(' ').visit(K_FOR).sql(' ').visit(length).sql(')');
|
||||
ctx.visit(N_SUBSTRING).sql('(').visit(field).sql(' ').visit(K_FROM).sql(' ').visit(startingPosition).sql(' ').visit(K_FOR).sql(' ').visit(length).sql(')');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -123,11 +123,12 @@ final class Substring extends AbstractField<String> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case DERBY:
|
||||
case SQLITE:
|
||||
functionName = F_SUBSTR;
|
||||
functionName = N_SUBSTR;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +39,6 @@ package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.DSL.two;
|
||||
import static org.jooq.impl.Keywords.F_TANH;
|
||||
import static org.jooq.impl.Names.N_TANH;
|
||||
import static org.jooq.impl.SQLDataType.NUMERIC;
|
||||
|
||||
@ -92,7 +91,7 @@ final class Tanh extends AbstractField<BigDecimal> {
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.visit(F_TANH).sql('(').visit(argument).sql(')');
|
||||
ctx.visit(N_TANH).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,10 +39,9 @@ package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.function;
|
||||
import static org.jooq.impl.DSL.keyword;
|
||||
import static org.jooq.impl.Keywords.F_DATEDIFF;
|
||||
import static org.jooq.impl.Keywords.F_STRFTIME;
|
||||
import static org.jooq.impl.Keywords.F_TIMESTAMPDIFF;
|
||||
import static org.jooq.impl.Keywords.K_MILLISECOND;
|
||||
import static org.jooq.impl.Names.N_DATEDIFF;
|
||||
import static org.jooq.impl.Names.N_STRFTIME;
|
||||
import static org.jooq.impl.Names.N_TIMESTAMPDIFF;
|
||||
import static org.jooq.impl.SQLDataType.INTEGER;
|
||||
import static org.jooq.impl.SQLDataType.INTERVALDAYTOSECOND;
|
||||
@ -126,7 +125,7 @@ final class TimestampDiff extends AbstractField<DayToSecond> {
|
||||
break;
|
||||
|
||||
case DERBY:
|
||||
ctx.sql("1000 * {fn ").visit(F_TIMESTAMPDIFF).sql('(').visit(keyword("sql_tsi_second")).sql(", ").visit(timestamp2).sql(", ").visit(timestamp1).sql(") }");
|
||||
ctx.sql("1000 * {fn ").visit(N_TIMESTAMPDIFF).sql('(').visit(keyword("sql_tsi_second")).sql(", ").visit(timestamp2).sql(", ").visit(timestamp1).sql(") }");
|
||||
break;
|
||||
|
||||
|
||||
@ -134,12 +133,12 @@ final class TimestampDiff extends AbstractField<DayToSecond> {
|
||||
|
||||
|
||||
case FIREBIRD:
|
||||
ctx.visit(F_DATEDIFF).sql('(').visit(K_MILLISECOND).sql(", ").visit(timestamp2).sql(", ").visit(timestamp1).sql(')');
|
||||
ctx.visit(N_DATEDIFF).sql('(').visit(K_MILLISECOND).sql(", ").visit(timestamp2).sql(", ").visit(timestamp1).sql(')');
|
||||
break;
|
||||
|
||||
case H2:
|
||||
case HSQLDB:
|
||||
ctx.visit(F_DATEDIFF).sql("('ms', ").visit(timestamp2).sql(", ").visit(timestamp1).sql(')');
|
||||
ctx.visit(N_DATEDIFF).sql("('ms', ").visit(timestamp2).sql(", ").visit(timestamp1).sql(')');
|
||||
break;
|
||||
|
||||
// MySQL's datetime operations operate on a microsecond level
|
||||
@ -150,11 +149,11 @@ final class TimestampDiff extends AbstractField<DayToSecond> {
|
||||
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
ctx.visit(F_TIMESTAMPDIFF).sql('(').visit(keyword("microsecond")).sql(", ").visit(timestamp2).sql(", ").visit(timestamp1).sql(") / 1000");
|
||||
ctx.visit(N_TIMESTAMPDIFF).sql('(').visit(keyword("microsecond")).sql(", ").visit(timestamp2).sql(", ").visit(timestamp1).sql(") / 1000");
|
||||
break;
|
||||
|
||||
case SQLITE:
|
||||
ctx.sql('(').visit(F_STRFTIME).sql("('%s', ").visit(timestamp1).sql(") - ").visit(F_STRFTIME).sql("('%s', ").visit(timestamp2).sql(")) * 1000");
|
||||
ctx.sql('(').visit(N_STRFTIME).sql("('%s', ").visit(timestamp1).sql(") - ").visit(N_STRFTIME).sql("('%s', ").visit(timestamp2).sql(")) * 1000");
|
||||
break;
|
||||
|
||||
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_TRIM;
|
||||
import static org.jooq.impl.Keywords.K_BOTH;
|
||||
import static org.jooq.impl.Keywords.K_FROM;
|
||||
import static org.jooq.impl.Names.N_TRIM;
|
||||
@ -90,7 +89,7 @@ final class Trim extends AbstractField<String> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(F_TRIM).sql('(').visit(argument).sql(')');
|
||||
ctx.visit(N_TRIM).sql('(').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -102,7 +101,7 @@ final class Trim extends AbstractField<String> {
|
||||
|
||||
|
||||
case SQLITE:
|
||||
ctx.visit(F_TRIM).sql('(').visit(argument).sql(", ").visit(characters).sql(')');
|
||||
ctx.visit(N_TRIM).sql('(').visit(argument).sql(", ").visit(characters).sql(')');
|
||||
break;
|
||||
|
||||
|
||||
@ -112,7 +111,7 @@ final class Trim extends AbstractField<String> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(F_TRIM).sql('(').visit(K_BOTH).sql(' ').visit(characters).sql(' ').visit(K_FROM).sql(' ').visit(argument).sql(')');
|
||||
ctx.visit(N_TRIM).sql('(').visit(K_BOTH).sql(' ').visit(characters).sql(' ').visit(K_FROM).sql(' ').visit(argument).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,12 +40,11 @@ package org.jooq.impl;
|
||||
import static java.math.BigDecimal.TEN;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.zero;
|
||||
import static org.jooq.impl.Keywords.F_ROUND;
|
||||
import static org.jooq.impl.Keywords.F_ROUND_DOWN;
|
||||
import static org.jooq.impl.Keywords.F_TRUNC;
|
||||
import static org.jooq.impl.Keywords.F_TRUNCATE;
|
||||
import static org.jooq.impl.Keywords.F_TRUNCNUM;
|
||||
import static org.jooq.impl.Names.N_ROUND;
|
||||
import static org.jooq.impl.Names.N_ROUND_DOWN;
|
||||
import static org.jooq.impl.Names.N_TRUNC;
|
||||
import static org.jooq.impl.Names.N_TRUNCATE;
|
||||
import static org.jooq.impl.Names.N_TRUNCNUM;
|
||||
import static org.jooq.impl.Tools.castIfNeeded;
|
||||
import static org.jooq.impl.Tools.extractVal;
|
||||
|
||||
@ -110,7 +109,7 @@ final class Trunc<T> extends AbstractField<T> {
|
||||
case H2:
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
ctx.visit(F_TRUNCATE).sql('(').visit(field).sql(", ").visit(decimals).sql(')');
|
||||
ctx.visit(N_TRUNCATE).sql('(').visit(field).sql(", ").visit(decimals).sql(')');
|
||||
break;
|
||||
|
||||
// Postgres TRUNC() only takes NUMERIC arguments, no
|
||||
@ -153,7 +152,7 @@ final class Trunc<T> extends AbstractField<T> {
|
||||
case CUBRID:
|
||||
case HSQLDB:
|
||||
default:
|
||||
ctx.visit(F_TRUNC).sql('(').visit(field).sql(", ").visit(decimals).sql(')');
|
||||
ctx.visit(N_TRUNC).sql('(').visit(field).sql(", ").visit(decimals).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,9 +38,8 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.Keywords.F_DATE_TRUNC;
|
||||
import static org.jooq.impl.Keywords.F_TRUNC;
|
||||
import static org.jooq.impl.Keywords.K_CAST;
|
||||
import static org.jooq.impl.Names.N_DATE_TRUNC;
|
||||
import static org.jooq.impl.Names.N_TRUNC;
|
||||
import static org.jooq.impl.Tools.castIfNeeded;
|
||||
|
||||
@ -90,7 +89,7 @@ final class TruncDate<T> extends AbstractField<T> {
|
||||
default: throwUnsupported();
|
||||
}
|
||||
|
||||
ctx.visit(F_TRUNC).sql('(').visit(date).sql(", ").visit(inline(keyword)).sql(')');
|
||||
ctx.visit(N_TRUNC).sql('(').visit(date).sql(", ").visit(inline(keyword)).sql(')');
|
||||
break;
|
||||
}
|
||||
|
||||
@ -143,7 +142,7 @@ final class TruncDate<T> extends AbstractField<T> {
|
||||
default: throwUnsupported();
|
||||
}
|
||||
|
||||
ctx.visit(F_DATE_TRUNC).sql('(').visit(inline(keyword)).sql(", ").visit(date).sql(')');
|
||||
ctx.visit(N_DATE_TRUNC).sql('(').visit(inline(keyword)).sql(", ").visit(date).sql(')');
|
||||
break;
|
||||
}
|
||||
|
||||
@ -242,7 +241,7 @@ final class TruncDate<T> extends AbstractField<T> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(F_TRUNC).sql('(').visit(date).sql(", ").visit(inline(keyword)).sql(')');
|
||||
ctx.visit(N_TRUNC).sql('(').visit(date).sql(", ").visit(inline(keyword)).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,8 +37,7 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Keywords.F_UCASE;
|
||||
import static org.jooq.impl.Keywords.F_UPPER;
|
||||
import static org.jooq.impl.Names.N_UCASE;
|
||||
import static org.jooq.impl.Names.N_UPPER;
|
||||
|
||||
import org.jooq.Context;
|
||||
@ -71,7 +70,7 @@ final class Upper extends AbstractField<String> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(F_UPPER).sql('(').visit(field).sql(')');
|
||||
ctx.visit(N_UPPER).sql('(').visit(field).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,42 +37,34 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Names.N_XMLDOCUMENT;
|
||||
|
||||
import org.jooq.Context;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.XML;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
final class XMLDocument extends AbstractField<XML> {
|
||||
|
||||
/**
|
||||
* Generated UID
|
||||
*/
|
||||
private static final long serialVersionUID = 4505809303211506197L;
|
||||
|
||||
private final Field<XML> content;
|
||||
|
||||
XMLDocument(Field<XML> content) {
|
||||
super(N_XMLDOCUMENT, SQLDataType.XML);
|
||||
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
ctx.visit(N_XMLDOCUMENT).sql('(').visit(content).sql(')');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* [/pro] */
|
||||
Loading…
Reference in New Issue
Block a user