Top Description Fields Constructors Methods
org.hsqldb

public Class ExpressionOp

extends Expression
Class Inheritance
Imports
org.hsqldb.error.Error, .ErrorCode, org.hsqldb.lib.ArrayUtil, .List, org.hsqldb.map.ValuePool, org.hsqldb.types.BinaryData, .BinaryType, .CharacterType, .DateFormat, .DateTimeType, .IntervalSecondData, .Type, .Types, java.time.format.DateTimeFormatter

Implementation of CAST, CASE, LIMIT and ZONE operations.
Authors
Campbell Burnet (campbell-burnet@users dot sourceforge.net), Fred Toussi (fredt@users dot sourceforge.net)
Since
1.9.0
Version
2.7.3

Field Summary

Modifier and TypeField and Description
pack-priv DateTimeFormatter
pack-priv static final ExpressionOp
pack-priv String
Inherited from org.hsqldb.Expression:
aliasBINARYcollationcolumnIndexdataTypeemptyArrayEXPR_FALSEEXPR_TRUEexprSubTypegroupingTypeisColumnConditionisColumnEqualisCorrelatedisDistinctAggregateisSingleColumnConditionisSingleColumnEqualisSingleColumnNotNullisSingleColumnNullLEFTnodeDataTypesnodesnoOptimisationnullabilityopTypeparameterIndexrangeGrouprangeGroupsresultTableColumnIndexRIGHTtableTERNARYTHIRDUNARYvalueData

Constructor Summary

AccessConstructor and Description
pack-priv
ExpressionOp(int type, Expression[] exprArray)

Creates a multiple arg operation expression

pack-priv
ExpressionOp(int type, Expression left, Expression right)

Creates a special binary operation expression

pack-priv
ExpressionOp(Expression e, Type dataType)

creates a CAST expression

pack-priv
ExpressionOp(Expression e, Type dataType, String template)

creates a CAST expression with template when template is null, it is a simple CAST

pack-priv
ExpressionOp(Expression e)

creates a special conversion for time / timestamp comparison

Method Summary

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

Overrides org.hsqldb.Expression.describe.

public boolean
equals(Expression other)

Overrides org.hsqldb.Expression.equals.

SIMPLE_COLUMN expressions can be of different Expression subclass types

public static Expression
getCastExpression(Session session, Expression e, Type dataType)

public static Expression
public String
getSQL()

Overrides org.hsqldb.Expression.getSQL.

For use with CHECK constraints.

public Object
public List<Expression>
resolveColumnReferences(Session session, RangeGroup rangeGroup, int rangeCount, RangeGroup[] rangeGroups, List<Expression> unresolvedSet, boolean acceptsSequences)

Overrides org.hsqldb.Expression.resolveColumnReferences.

public void
pack-priv void
pack-priv void
resolveTypesForCaseWhen(Session session, Expression parent)

For CASE WHEN and its special cases section 9.3 of the SQL standard on type aggregation is implemented.

Inherited from org.hsqldb.Expression:
checkValidCheckConstraintcollectAllExpressionscollectAllSubqueriescollectObjectNamescollectRangeVariablescollectRangeVariablesconvertToTypecostFactorcountNullsduplicateequalsequalsequalsgetAggregatedValuegetAliasgetCheckSelectgetColumngetColumnIndexgetColumnNamegetConditiongetConstantValueNoCheckgetContextSQLgetDataTypegetDegreegetIndexableExpressiongetJoinRangeVariablesgetLeftNodegetNodeDataTypegetNodeDataTypesgetNullabilitygetRangeVariablegetResultgetRightNodegetRowValuegetSimpleNamegetSubqueriesgetSubTypegetTablegetTypegetUnkeyedColumnsgetValuegetValueClassNamehasAggregatehasConditionhashCodehasNonDeterministicFunctionhasReferencehasReferenceinsertValuesIntoSubqueryTableisComposedOfisComposedOfisConditionRangeVariableisCorrelatedisDistinctAggregateisDynamicParamisFalseisIndexableisSelfAggregateisTrueisUnresolvedParammaterialiseprepareTablereplaceAliasInOrderByreplaceColumnReferencesreplaceExpressionsreplaceNodereplaceRangeVariablesresetColumnReferencesresolveCheckOrGenExpressionresolveColumnReferencesresolveColumnSetresolveColumnSetresolveGrantFiltersetAggregatesetAliassetAsConstantValuesetAsConstantValuesetAttributesAsColumnsetCollationsetConditionsetCorrelatedReferencessetDataTypesetLeftNodesetNoOptimisationsetRightNodesetSubTypeswapLeftAndRightNodestestConditionupdateAggregatingValueupdateAggregatingValue

Field Detail

dateTimeFormatterback to summary
pack-priv DateTimeFormatter dateTimeFormatter
limitOneExpressionback to summary
pack-priv static final ExpressionOp limitOneExpression
templateback to summary
pack-priv String template

Constructor Detail

ExpressionOpback to summary
pack-priv ExpressionOp(int type, Expression[] exprArray)

Creates a multiple arg operation expression

ExpressionOpback to summary
pack-priv ExpressionOp(int type, Expression left, Expression right)

Creates a special binary operation expression

ExpressionOpback to summary
pack-priv ExpressionOp(Expression e, Type dataType)

creates a CAST expression

ExpressionOpback to summary
pack-priv ExpressionOp(Expression e, Type dataType, String template)

creates a CAST expression with template when template is null, it is a simple CAST

ExpressionOpback to summary
pack-priv ExpressionOp(Expression e)

creates a special conversion for time / timestamp comparison

Method Detail

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

Overrides org.hsqldb.Expression.describe.

equalsback to summary
public 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

getCastExpressionback to summary
public static Expression getCastExpression(Session session, Expression e, Type dataType)
getConvertExpressionback to summary
public static Expression getConvertExpression(Session session, Expression e, Type dataType)
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.

resolveColumnReferencesback to summary
public List<Expression> resolveColumnReferences(Session session, RangeGroup rangeGroup, int rangeCount, RangeGroup[] rangeGroups, List<Expression> unresolvedSet, boolean acceptsSequences)

Overrides org.hsqldb.Expression.resolveColumnReferences.

resolveTypesback to summary
public void resolveTypes(Session session, Expression parent)

Overrides org.hsqldb.Expression.resolveTypes.

resolveTypesForAlternativeback to summary
pack-priv void resolveTypesForAlternative(Session session)
resolveTypesForCaseWhenback to summary
pack-priv void resolveTypesForCaseWhen(Session session, Expression parent)

For CASE WHEN and its special cases section 9.3 of the SQL standard on type aggregation is implemented.