Package org.h2.mode
Class ModeFunction
- java.lang.Object
-
- org.h2.expression.Expression
-
- org.h2.expression.OperationN
-
- org.h2.expression.function.FunctionN
-
- org.h2.mode.ModeFunction
-
- All Implemented Interfaces:
ExpressionWithVariableParameters,NamedExpression,HasSQL,Typed
- Direct Known Subclasses:
FunctionsDB2Derby,FunctionsLegacy,FunctionsMSSQLServer,FunctionsMySQL,FunctionsOracle,FunctionsPostgreSQL
public abstract class ModeFunction extends FunctionN
Base class for mode-specific functions.
-
-
Field Summary
Fields Modifier and Type Field Description protected FunctionInfoinfoThe information about this function.protected static intVAR_ARGSConstant for variable number of arguments.-
Fields inherited from class org.h2.expression.OperationN
args, argsCount, type
-
Fields inherited from class org.h2.expression.Expression
AUTO_PARENTHESES, MAP_IN_AGGREGATE, MAP_IN_WINDOW, MAP_INITIAL, WITH_PARENTHESES, WITHOUT_PARENTHESES
-
Fields inherited from interface org.h2.util.HasSQL
ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoneWithParameters()This method must be called after all the parameters have been set.static ExpressiongetCompatibilityDateTimeValueFunction(Database database, java.lang.String name, int scale)Get an instance of the given function without parentheses for this database.static ModeFunctiongetFunction(Database database, java.lang.String name)Get an instance of the given function for this database.java.lang.StringgetName()Get the name.booleanisEverything(ExpressionVisitor visitor)Check if this expression and all sub-expressions can fulfill a criteria.-
Methods inherited from class org.h2.expression.function.FunctionN
getUnenclosedSQL, getValue, getValue
-
Methods inherited from class org.h2.expression.OperationN
addParameter, getCost, getSubexpression, getSubexpressionCount, getType, inlineSubexpressions, mapColumns, optimizeArguments, setEvaluatable, updateAggregate
-
Methods inherited from class org.h2.expression.Expression
addFilterConditions, createIndexConditions, getAlias, getBooleanValue, getColumnName, getColumnNameForView, getEnclosedSQL, getNonAliasExpression, getNotIfPossible, getNullable, getSchemaName, getSQL, getSQL, getSQL, getSQL, getTableAlias, getTableName, getTypeIfStaticallyKnown, getWhenSQL, getWhenValue, isConstant, isIdentity, isNullConstant, isValueSet, isWhenConditionOperand, needParentheses, optimize, optimizeCondition, toString, writeExpressions, writeExpressions
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.h2.util.HasSQL
getTraceSQL
-
-
-
-
Field Detail
-
VAR_ARGS
protected static final int VAR_ARGS
Constant for variable number of arguments.- See Also:
- Constant Field Values
-
info
protected final FunctionInfo info
The information about this function.
-
-
Method Detail
-
getFunction
public static ModeFunction getFunction(Database database, java.lang.String name)
Get an instance of the given function for this database. If no function with this name is found, null is returned.- Parameters:
database- the databasename- the upper case function name- Returns:
- the function object or null
-
getCompatibilityDateTimeValueFunction
public static Expression getCompatibilityDateTimeValueFunction(Database database, java.lang.String name, int scale)
Get an instance of the given function without parentheses for this database. If no function with this name is found, null is returned.- Parameters:
database- the databasename- the upper case function namescale- the scale, or-1- Returns:
- the function object or null
-
doneWithParameters
public void doneWithParameters()
Description copied from interface:ExpressionWithVariableParametersThis method must be called after all the parameters have been set. It checks if the parameter count is correct when required by the implementation.- Specified by:
doneWithParametersin interfaceExpressionWithVariableParameters- Overrides:
doneWithParametersin classOperationN
-
getName
public java.lang.String getName()
Description copied from interface:NamedExpressionGet the name.- Returns:
- the name in uppercase
-
isEverything
public boolean isEverything(ExpressionVisitor visitor)
Description copied from class:ExpressionCheck if this expression and all sub-expressions can fulfill a criteria. If any part returns false, the result is false.- Overrides:
isEverythingin classOperationN- Parameters:
visitor- the visitor- Returns:
- if the criteria can be fulfilled
-
-