public final class DateTimeFunction extends Function1_2
| Modifier and Type | Field and Description |
|---|---|
static int |
CENTURY
Century.
|
static int |
DATE_TRUNC
DATE_TRUNC() (non-standard).
|
static int |
DATEADD
DATEADD() (non-standard).
|
static int |
DATEDIFF
DATEDIFF() (non-standard).
|
static int |
DAY
Day of month.
|
static int |
DAY_OF_WEEK
Day of week (locale-specific).
|
static int |
DAY_OF_YEAR
Day of year.
|
static int |
DECADE
Decade.
|
static int |
DOW
Day of week (locale-specific) for PostgreSQL compatibility.
|
static int |
EPOCH
Epoch.
|
static int |
EXTRACT
EXTRACT().
|
static int |
HOUR
Hour.
|
static int |
ISO_DAY_OF_WEEK
ISO day of week.
|
static int |
ISO_WEEK
ISO week.
|
static int |
ISO_WEEK_YEAR
ISO week-based year.
|
static int |
LAST_DAY
LAST_DAY() (non-standard);
|
static int |
MICROSECOND
Microsecond.
|
static int |
MILLENNIUM
Millennium.
|
static int |
MILLISECOND
Millisecond.
|
static int |
MINUTE
Minute.
|
static int |
MONTH
Month.
|
static int |
NANOSECOND
Nanosecond.
|
static int |
QUARTER
Quarter.
|
static int |
SECOND
Second.
|
static int |
TIMEZONE_HOUR
Time zone hour.
|
static int |
TIMEZONE_MINUTE
Time zone minute.
|
static int |
TIMEZONE_SECOND
Time zone second.
|
static int |
WEEK
Week (locale-specific).
|
static int |
WEEK_YEAR
Week-based year (locale-specific).
|
static int |
YEAR
Year.
|
left, right, typeAUTO_PARENTHESES, MAP_IN_AGGREGATE, MAP_IN_WINDOW, MAP_INITIAL, WITH_PARENTHESES, WITHOUT_PARENTHESESADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS| Constructor and Description |
|---|
DateTimeFunction(int function,
int field,
Expression arg1,
Expression arg2) |
| Modifier and Type | Method and Description |
|---|---|
static Value |
dateadd(SessionLocal session,
int field,
long count,
Value v)
DATEADD function.
|
static int |
getField(java.lang.String name)
Get date-time field for the specified name.
|
static java.lang.String |
getFieldName(int field)
Get the name of the specified date-time field.
|
java.lang.String |
getName()
Get the name.
|
java.lang.StringBuilder |
getUnenclosedSQL(java.lang.StringBuilder builder,
int sqlFlags)
Get the SQL statement of this expression.
|
Value |
getValue(SessionLocal session,
Value v1,
Value v2)
Returns the value of this function.
|
Expression |
optimize(SessionLocal session)
Try to optimize the expression.
|
getValuegetCost, getSubexpression, getSubexpressionCount, getType, isEverything, mapColumns, setEvaluatable, updateAggregateaddFilterConditions, createIndexConditions, getAlias, getBooleanValue, getColumnName, getColumnNameForView, getEnclosedSQL, getNonAliasExpression, getNotIfPossible, getNullable, getSchemaName, getSQL, getSQL, getSQL, getSQL, getTableAlias, getTableName, getWhenSQL, getWhenValue, isConstant, isIdentity, isNullConstant, isValueSet, isWhenConditionOperand, needParentheses, optimizeCondition, toString, writeExpressions, writeExpressionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTraceSQLpublic static final int EXTRACT
public static final int DATE_TRUNC
public static final int DATEADD
public static final int DATEDIFF
public static final int LAST_DAY
public static final int YEAR
public static final int MONTH
public static final int DAY
public static final int HOUR
public static final int MINUTE
public static final int SECOND
public static final int TIMEZONE_HOUR
public static final int TIMEZONE_MINUTE
public static final int TIMEZONE_SECOND
public static final int MILLENNIUM
public static final int CENTURY
public static final int DECADE
public static final int QUARTER
public static final int MILLISECOND
public static final int MICROSECOND
public static final int NANOSECOND
public static final int DAY_OF_YEAR
public static final int ISO_DAY_OF_WEEK
public static final int ISO_WEEK
public static final int ISO_WEEK_YEAR
public static final int DAY_OF_WEEK
public static final int WEEK
public static final int WEEK_YEAR
public static final int EPOCH
public static final int DOW
public DateTimeFunction(int function,
int field,
Expression arg1,
Expression arg2)
public static int getField(java.lang.String name)
name - the nameDbException - on unknown field namepublic static java.lang.String getFieldName(int field)
field - the date-time fieldpublic Value getValue(SessionLocal session, Value v1, Value v2)
Function1_2getValue in class Function1_2session - the sessionv1 - the value of first argumentv2 - the value of second argument, or nullpublic static Value dateadd(SessionLocal session, int field, long count, Value v)
session - the sessionfield - the date-time fieldcount - count to addv - value to add topublic Expression optimize(SessionLocal session)
Expressionoptimize in class Expressionsession - the sessionpublic java.lang.StringBuilder getUnenclosedSQL(java.lang.StringBuilder builder,
int sqlFlags)
ExpressiongetUnenclosedSQL in class Function1_2builder - string buildersqlFlags - formatting flagspublic java.lang.String getName()
NamedExpression