Top Description Fields Constructors Methods
org.hsqldb

public Class ExpressionAggregate

extends Expression
Class Inheritance
Imports
org.hsqldb.error.Error, .ErrorCode, org.hsqldb.lib.ArrayListIdentity, .List, org.hsqldb.map.ValuePool, org.hsqldb.types.DTIType, .IntervalType, .NumberType, .RowType, .Type, .Types

Implementation of aggregate operations
Author
Fred Toussi (fredt@users dot sourceforge.net)
Since
1.9.0
Version
2.7.3

Field Summary

Modifier and TypeField and Description
pack-priv Expression
Inherited from org.hsqldb.Expression:
aliasBINARYcollationcolumnIndexdataTypeemptyArrayEXPR_FALSEEXPR_TRUEexprSubTypegroupingTypeisColumnConditionisColumnEqualisCorrelatedisDistinctAggregateisSingleColumnConditionisSingleColumnEqualisSingleColumnNotNullisSingleColumnNullLEFTnodeDataTypesnodesnoOptimisationnullabilityopTypeparameterIndexrangeGrouprangeGroupsresultTableColumnIndexRIGHTtableTERNARYTHIRDUNARYvalueData

Constructor Summary

AccessConstructor and Description
pack-priv
ExpressionAggregate(int type, boolean distinct, Expression e)

Method Summary

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

Overrides org.hsqldb.Expression.describe.

pack-priv boolean
equals(Expression other)

Overrides org.hsqldb.Expression.equals.

SIMPLE_COLUMN expressions can be of different Expression subclass types

public Object

Returns:

object
getAggregatedValue
(Session
session
session
,
SetFunction
instance of set function or value
currValue
)

Overrides org.hsqldb.Expression.getAggregatedValue.

Get the result of a SetFunction or an ordinary value

public Expression
pack-priv SetFunction
public String
getSQL()

Overrides org.hsqldb.Expression.getSQL.

For use with CHECK constraints.

pack-priv static Type
getType(Session session, int setType, Type dataType)

During parsing and before an instance of SetFunction is created, getType is called with type parameter set to correct type when main SELECT statements contain aggregates.

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

Overrides org.hsqldb.Expression.resolveColumnReferences.

public void
public void
public SetFunction
public SetFunction
Inherited from org.hsqldb.Expression:
checkValidCheckConstraintcollectAllExpressionscollectAllSubqueriescollectObjectNamescollectRangeVariablescollectRangeVariablesconvertToTypecostFactorcountNullsduplicateequalsequalsequalsgetAliasgetCheckSelectgetColumngetColumnIndexgetColumnNamegetConstantValueNoCheckgetContextSQLgetDataTypegetDegreegetIndexableExpressiongetJoinRangeVariablesgetLeftNodegetNodeDataTypegetNodeDataTypesgetNullabilitygetRangeVariablegetResultgetRightNodegetRowValuegetSimpleNamegetSubqueriesgetSubTypegetTablegetTypegetUnkeyedColumnsgetValuegetValuegetValueClassNamehasAggregatehashCodehasNonDeterministicFunctionhasReferencehasReferenceinsertValuesIntoSubqueryTableisComposedOfisComposedOfisConditionRangeVariableisCorrelatedisDistinctAggregateisDynamicParamisFalseisIndexableisTrueisUnresolvedParammaterialiseprepareTablereplaceAliasInOrderByreplaceColumnReferencesreplaceExpressionsreplaceNodereplaceRangeVariablesresetColumnReferencesresolveCheckOrGenExpressionresolveColumnReferencesresolveColumnSetresolveColumnSetresolveGrantFiltersetAggregatesetAliassetAsConstantValuesetAsConstantValuesetAttributesAsColumnsetCollationsetCorrelatedReferencessetDataTypesetLeftNodesetNoOptimisationsetRightNodesetSubTypeswapLeftAndRightNodestestCondition

Field Detail

conditionback to summary
pack-priv Expression condition

Constructor Detail

ExpressionAggregateback to summary
pack-priv ExpressionAggregate(int type, boolean distinct, Expression e)

Method Detail

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

Overrides org.hsqldb.Expression.describe.

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

getAggregatedValueback to summary
public Object getAggregatedValue(Session session, SetFunction currValue)

Overrides org.hsqldb.Expression.getAggregatedValue.

Get the result of a SetFunction or an ordinary value

Parameters
session:Session

session

currValue:SetFunction

instance of set function or value

Returns:Object

object

getConditionback to summary
public Expression getCondition()

Overrides org.hsqldb.Expression.getCondition.

getSetFunctionback to summary
pack-priv SetFunction getSetFunction(Session session)
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.

getTypeback to summary
pack-priv static Type getType(Session session, int setType, Type dataType)

During parsing and before an instance of SetFunction is created, getType is called with type parameter set to correct type when main SELECT statements contain aggregates.

hasConditionback to summary
public boolean hasCondition()

Overrides org.hsqldb.Expression.hasCondition.

isSelfAggregateback to summary
public boolean isSelfAggregate()

Overrides org.hsqldb.Expression.isSelfAggregate.

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.

setConditionback to summary
public void setCondition(Expression e)

Overrides org.hsqldb.Expression.setCondition.

updateAggregatingValueback to summary
public SetFunction updateAggregatingValue(Session session, SetFunction currValue)

Overrides org.hsqldb.Expression.updateAggregatingValue.

updateAggregatingValueback to summary
public SetFunction updateAggregatingValue(Session session, SetFunction currValue, SetFunction value)

Overrides org.hsqldb.Expression.updateAggregatingValue.