## org.eclipse.datatools.connectivity.oda.spec.result
Class ResultProjection

    java.lang.Object
      org.eclipse.datatools.connectivity.oda.spec.result.ResultProjection

    public class ResultProjection

extends java.lang.Object

Specification for the projection of an `IResultSet` to be retrieved by an associated `IQuery`.

Since:
  3.3 (DTP 1.8)

Method Summary
`void` `addResultColumn(ExpressionVariable columnExprVariable)` Appends a new result column to the query result set.
`java.util.Map<ColumnIdentifier,ExpressionVariable>` `getAddedResultColumns()` Returns a map of result columns that are to be dynamically added to the query result set.
`java.util.Map<ColumnIdentifier,AggregateExpression>` `getAggregatedColumns()` Returns a map of projected columns, each with corresponding aggregate expression.
`AggregateExpression` `getAggregateProjection(ColumnIdentifier resultColumn)` Gets the aggregate expression on the specified result set column.
`java.util.List<ColumnIdentifier>` `getHiddenResultColumns()` Returns a list of result columns that are to be dynamically hidden from the query result set.
`void` `hideResultColumn(ColumnIdentifier resultColumn)` Hides the specified result column in the query result.
`boolean` `isEmpty()` Indicates whether this has an empty content.
`void` `setProjection(ColumnIdentifier resultColumn, AggregateExpression aggregate)` Specifies an aggregate expression whose output value is projected on the specified result set column identifier.
`java.lang.String` `toString()`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Method Detail

### setProjection

    public void setProjection(ColumnIdentifier resultColumn,
                              AggregateExpression aggregate)
                       throws OdaException

  Specifies an aggregate expression whose output value is projected on the specified result set column identifier.
  The aggregation is applied on the values of its input source variable(s) across a set of data records. Each set is grouped by the unique values of all the other result set column(s) that do not have an aggregate expression projected. Hidden result set column(s) are excluded from the groupings. If the result set has sorting specification defined, the order of the column groupings should be in the same sequence as the sorted columns.
  A projected tabular result set returns one row for each group.

  Parameters:
    `resultColumn` - the column identifier in the projected result set targeted for the output of the specified aggregate expression
    `aggregate` - an `AggregateExpression` whose output value is projected on the specified result set column
  Throws:
    `OdaException`

### getAggregateProjection

    public AggregateExpression getAggregateProjection(ColumnIdentifier resultColumn)

  Gets the aggregate expression on the specified result set column.

  Parameters:
    `resultColumnNum` - the projected column number (1-based) in the result set
  Returns:
    an `AggregateExpression` whose output value is projected on the specified result set column, or null if none is specified
  See Also:
    `setProjection(ColumnIdentifier, AggregateExpression)`

### getAggregatedColumns

    public java.util.Map<ColumnIdentifier,AggregateExpression> getAggregatedColumns()

  Returns a map of projected columns, each with corresponding aggregate expression.

  Returns:
    the map of projected column aggregation; may be empty if no column aggregate is specified
  See Also:
    `setProjection(ColumnIdentifier, AggregateExpression)`, `#addResultColumn(AggregateExpression)`

### addResultColumn

    public void addResultColumn(ExpressionVariable columnExprVariable)
                         throws OdaException

  Appends a new result column to the query result set. The appended result column can be referenced in the result set by the specified variable's alias.

  Parameters:
    `columnExprVariable` - a variable that resolves to the value of the new column
  Throws:
    `OdaException`

### getAddedResultColumns

    public java.util.Map<ColumnIdentifier,ExpressionVariable> getAddedResultColumns()

  Returns a map of result columns that are to be dynamically added to the query result set. Each result column in the map is associated with an input variable that resolves to the column value.

  Returns:
    the map of projected new result columns; may be empty if no column is to be dynamically added
  See Also:
    `addResultColumn(ExpressionVariable)`, `#addResultColumn(AggregateExpression)`

### hideResultColumn

    public void hideResultColumn(ColumnIdentifier resultColumn)
                          throws OdaException

  Hides the specified result column in the query result. Any associated aggregate projection is also removed.

  Parameters:
    `resultColumn` -
  Throws:
    `OdaException`

### getHiddenResultColumns

    public java.util.List<ColumnIdentifier> getHiddenResultColumns()

  Returns a list of result columns that are to be dynamically hidden from the query result set.

  Returns:
    the map of projected hidden result columns; may be empty if no column is to be dynamically hidden
  See Also:
    `hideResultColumn(ColumnIdentifier)`

### isEmpty

    public boolean isEmpty()

  Indicates whether this has an empty content.

  Returns:
    true if this has an empty content; false otherwise
  Since:
    3.3.1 (DTP 1.8.1)

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`