Top Description Fields Constructors Methods
org.hsqldb

public Class FunctionSQL

extends Expression
Class Inheritance
Known Direct Subclasses
org.hsqldb.FunctionCustom
Imports
org.hsqldb.ParserDQL.CompileContext, org.hsqldb.error.Error, .ErrorCode, org.hsqldb.lib.IntValueHashMap, .OrderedIntHashSet, org.hsqldb.map.ValuePool, org.hsqldb.types.BinaryData, .BinaryType, .BlobData, .CharacterType, .DTIType, .DateTimeType, .IntervalType, .NumberType, .Type, .Types

Implementation of SQL standard function calls
Author
Fred Toussi (fredt@users dot sourceforge.net)
Since
1.9.0
Version
2.7.4

Field Summary

Modifier and TypeField and Description
pack-priv static final short[]
pack-priv static final short[]
private static final int
protected static final int
private static final int
private static final int
protected static final int
private static final int
private static final int
protected static final int
private static final int
private static final int
private static final int
private static final int
protected static final int
protected static final int
private static final int
private static final int
private static final int
protected static final int
private static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
private static final int
private static final int
private static final int
protected static final int
private static final int
pack-priv static final int
private static final int
protected static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
protected static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
protected static final int
protected static final int
private static final int
private static final int
pack-priv int
pack-priv boolean
pack-priv boolean
pack-priv String
pack-priv static OrderedIntHashSet
pack-priv static final short[]
pack-priv static final short[]
pack-priv static final short[]
pack-priv static final short[]
pack-priv static final short[]
pack-priv short[]
pack-priv short[]
pack-priv static final short[]
pack-priv static IntValueHashMap<String>
pack-priv static final short[]
pack-priv static final short[]
pack-priv static IntValueHashMap<String>
Inherited from org.hsqldb.Expression:
aliasBINARYcollationcolumnIndexdataTypeemptyArrayEXPR_FALSEEXPR_TRUEexprSubTypegroupingTypeisColumnConditionisColumnEqualisCorrelatedisDistinctAggregateisSingleColumnConditionisSingleColumnEqualisSingleColumnNotNullisSingleColumnNullLEFTnodeDataTypesnodesnoOptimisationnullabilityopTypeparameterIndexrangeGrouprangeGroupsresultTableColumnIndexRIGHTtableTERNARYTHIRDUNARYvalueData

Constructor Summary

AccessConstructor and Description
protected
protected
FunctionSQL(int id)

Method Summary

Modifier and TypeMethod and Description
public String
describe(Session session, int blanks)

Overrides org.hsqldb.Expression.describe.

Returns a String representation of this object.

pack-priv boolean
equals(Expression other)

Overrides org.hsqldb.Expression.equals.

SIMPLE_COLUMN expressions can be of different Expression subclass types

pack-priv Object
getExtractValue(Session session, Object[] data)

public Expression
public String
getSQL()

Overrides org.hsqldb.Expression.getSQL.

For use with CHECK constraints.

public Object
getValue(Session session)

Overrides org.hsqldb.Expression.getValue.

Evaluates and returns this Function in the context of the session.

pack-priv Object
getValue(Session session, Object[] data)

public int
hashCode()

Overrides org.hsqldb.Expression.hashCode.

Returns a hash code value for this object.

public boolean
public boolean
public static FunctionSQL
public void
public void
Inherited from org.hsqldb.Expression:
checkValidCheckConstraintcollectAllExpressionscollectAllSubqueriescollectObjectNamescollectRangeVariablescollectRangeVariablesconvertToTypecostFactorcountNullsduplicateequalsequalsequalsgetAggregatedValuegetAliasgetCheckSelectgetColumngetColumnIndexgetColumnNamegetConditiongetConstantValueNoCheckgetContextSQLgetDataTypegetDegreegetIndexableExpressiongetJoinRangeVariablesgetLeftNodegetNodeDataTypegetNodeDataTypesgetNullabilitygetRangeVariablegetResultgetRightNodegetRowValuegetSimpleNamegetSubqueriesgetSubTypegetTablegetTypegetUnkeyedColumnsgetValuegetValueClassNamehasAggregatehasConditionhasNonDeterministicFunctionhasReferencehasReferenceinsertValuesIntoSubqueryTableisComposedOfisComposedOfisConditionRangeVariableisCorrelatedisDistinctAggregateisDynamicParamisFalseisIndexableisSelfAggregateisTrueisUnresolvedParammaterialiseprepareTablereplaceAliasInOrderByreplaceColumnReferencesreplaceExpressionsreplaceNodereplaceRangeVariablesresetColumnReferencesresolveCheckOrGenExpressionresolveColumnReferencesresolveColumnReferencesresolveColumnSetresolveColumnSetresolveGrantFiltersetAggregatesetAliassetAsConstantValuesetAsConstantValuesetAttributesAsColumnsetCollationsetConditionsetCorrelatedReferencessetDataTypesetLeftNodesetNoOptimisationsetRightNodesetSubTypeswapLeftAndRightNodestestConditionupdateAggregatingValueupdateAggregatingValue

Field Detail

doubleParamListback to summary
pack-priv static final short[] doubleParamList
emptyParamListback to summary
pack-priv static final short[] emptyParamList
FUNC_ABSback to summary
private static final int FUNC_ABS
FUNC_BIT_LENGTHback to summary
protected static final int FUNC_BIT_LENGTH
FUNC_CARDINALITYback to summary
private static final int FUNC_CARDINALITY
FUNC_CEILINGback to summary
private static final int FUNC_CEILING
FUNC_CHAR_LENGTHback to summary
protected static final int FUNC_CHAR_LENGTH
FUNC_CHAR_NORMALIZEback to summary
private static final int FUNC_CHAR_NORMALIZE
FUNC_CURRENT_CATALOGback to summary
private static final int FUNC_CURRENT_CATALOG
FUNC_CURRENT_DATEback to summary
protected static final int FUNC_CURRENT_DATE
FUNC_CURRENT_DEFAULT_TRANSFORM_GROUPback to summary
private static final int FUNC_CURRENT_DEFAULT_TRANSFORM_GROUP
FUNC_CURRENT_PATHback to summary
private static final int FUNC_CURRENT_PATH
FUNC_CURRENT_ROLEback to summary
private static final int FUNC_CURRENT_ROLE
FUNC_CURRENT_SCHEMAback to summary
private static final int FUNC_CURRENT_SCHEMA
FUNC_CURRENT_TIMEback to summary
protected static final int FUNC_CURRENT_TIME
FUNC_CURRENT_TIMESTAMPback to summary
protected static final int FUNC_CURRENT_TIMESTAMP
FUNC_CURRENT_TRANSFORM_GROUP_FOR_TYPEback to summary
private static final int FUNC_CURRENT_TRANSFORM_GROUP_FOR_TYPE
FUNC_CURRENT_USERback to summary
private static final int FUNC_CURRENT_USER
FUNC_EXPback to summary
private static final int FUNC_EXP
FUNC_EXTRACTback to summary
protected static final int FUNC_EXTRACT
FUNC_FLOORback to summary
private static final int FUNC_FLOOR
FUNC_FOLD_LOWERback to summary
protected static final int FUNC_FOLD_LOWER
FUNC_FOLD_UPPERback to summary
protected static final int FUNC_FOLD_UPPER
FUNC_LNback to summary
protected static final int FUNC_LN
FUNC_LOCALTIMEback to summary
protected static final int FUNC_LOCALTIME
FUNC_LOCALTIMESTAMPback to summary
protected static final int FUNC_LOCALTIMESTAMP
FUNC_MAX_CARDINALITYback to summary
private static final int FUNC_MAX_CARDINALITY
FUNC_MODback to summary
private static final int FUNC_MOD
FUNC_OCCURENCES_REGEXback to summary
private static final int FUNC_OCCURENCES_REGEX
FUNC_OCTET_LENGTHback to summary
protected static final int FUNC_OCTET_LENGTH
FUNC_OVERLAY_BINARYback to summary
private static final int FUNC_OVERLAY_BINARY
FUNC_OVERLAY_CHARback to summary
pack-priv static final int FUNC_OVERLAY_CHAR
FUNC_POSITION_BINARYback to summary
private static final int FUNC_POSITION_BINARY
FUNC_POSITION_CHARback to summary
protected static final int FUNC_POSITION_CHAR
FUNC_POSITION_REGEXback to summary
private static final int FUNC_POSITION_REGEX
FUNC_POWERback to summary
private static final int FUNC_POWER
FUNC_REGEX_TRANSLITERATIONback to summary
private static final int FUNC_REGEX_TRANSLITERATION
FUNC_SESSION_USERback to summary
private static final int FUNC_SESSION_USER
FUNC_SQRTback to summary
private static final int FUNC_SQRT
FUNC_SUBSTRING_BINARYback to summary
private static final int FUNC_SUBSTRING_BINARY
FUNC_SUBSTRING_CHARback to summary
protected static final int FUNC_SUBSTRING_CHAR
FUNC_SUBSTRING_REG_EXPRback to summary
private static final int FUNC_SUBSTRING_REG_EXPR
FUNC_SUBSTRING_REGEXback to summary
private static final int FUNC_SUBSTRING_REGEX
FUNC_SYSTEM_USERback to summary
private static final int FUNC_SYSTEM_USER
FUNC_TRANSCODINGback to summary
private static final int FUNC_TRANSCODING
FUNC_TRANSLITERATIONback to summary
private static final int FUNC_TRANSLITERATION
FUNC_TRIM_ARRAYback to summary
private static final int FUNC_TRIM_ARRAY
FUNC_TRIM_BINARYback to summary
private static final int FUNC_TRIM_BINARY
FUNC_TRIM_CHARback to summary
protected static final int FUNC_TRIM_CHAR
FUNC_USERback to summary
protected static final int FUNC_USER
FUNC_VALUEback to summary
private static final int FUNC_VALUE
FUNC_WIDTH_BUCKETback to summary
private static final int FUNC_WIDTH_BUCKET
funcTypeback to summary
pack-priv int funcType
isDeterministicback to summary
pack-priv boolean isDeterministic
isSQLValueFunctionback to summary
pack-priv boolean isSQLValueFunction
nameback to summary
pack-priv String name
nonDeterministicFuncSetback to summary
pack-priv static OrderedIntHashSet nonDeterministicFuncSet
noParamListback to summary
pack-priv static final short[] noParamList
optionalDoubleParamListback to summary
pack-priv static final short[] optionalDoubleParamList
optionalIntegerParamListback to summary
pack-priv static final short[] optionalIntegerParamList
optionalNoParamListback to summary
pack-priv static final short[] optionalNoParamList
optionalSingleParamListback to summary
pack-priv static final short[] optionalSingleParamList
parseListback to summary
pack-priv short[] parseList
parseListAltback to summary
pack-priv short[] parseListAlt
quadParamListback to summary
pack-priv static final short[] quadParamList
regularFuncMapback to summary
pack-priv static IntValueHashMap<String> regularFuncMap
singleParamListback to summary
pack-priv static final short[] singleParamList
tripleParamListback to summary
pack-priv static final short[] tripleParamList
valueFuncMapback to summary
pack-priv static IntValueHashMap<String> valueFuncMap

Constructor Detail

FunctionSQLback to summary
protected FunctionSQL()
FunctionSQLback to summary
protected FunctionSQL(int id)

Method Detail

describeback to summary
public String describe(Session session, int blanks)

Overrides org.hsqldb.Expression.describe.

Returns a String representation of this object.

equalsback to summary
pack-priv boolean equals(Expression other)

Overrides org.hsqldb.Expression.equals.

Doc from org.hsqldb.Expression.equals.

SIMPLE_COLUMN expressions can be of different Expression subclass types

getExtractValueback to summary
pack-priv Object getExtractValue(Session session, Object[] data)
getFunctionExpressionback to summary
public Expression getFunctionExpression()
getSQLback to summary
public String getSQL()

Overrides org.hsqldb.Expression.getSQL.

Doc from org.hsqldb.Expression.getSQL.

For use with CHECK constraints. Under development. Currently supports a subset of expressions and is suitable for CHECK search conditions that refer only to the inserted/updated row. For full DDL reporting of VIEW select queries and CHECK search conditions, future improvements here are dependent upon improvements to SELECT query parsing, so that it is performed in a number of passes. An early pass should result in the query turned into an Expression tree that contains the information in the original SQL without any alterations, and with tables and columns all resolved. This Expression can then be preserved for future use. Table and column names that are not user-defined aliases should be kept as the HsqlName structures so that table or column renaming is reflected in the precompiled query.

getValueback to summary
public Object getValue(Session session)

Overrides org.hsqldb.Expression.getValue.

Evaluates and returns this Function in the context of the session.

getValueback to summary
pack-priv Object getValue(Session session, Object[] data)
hashCodeback to summary
public int hashCode()

Overrides org.hsqldb.Expression.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
isDeterministicback to summary
public boolean isDeterministic()
isValueFunctionback to summary
public boolean isValueFunction()
newSQLFunctionback to summary
public static FunctionSQL newSQLFunction(String token, ParserDQL.CompileContext context)
resolveTypesback to summary
public void resolveTypes(Session session, Expression parent)

Overrides org.hsqldb.Expression.resolveTypes.

setArgumentsback to summary
public void setArguments(Expression[] newNodes)