org.sormula.operation.aggregate
Class SelectCountOperation<R,T>

java.lang.Object
  extended by org.sormula.operation.SqlOperation<R>
      extended by org.sormula.operation.ScalarSelectOperation<R>
          extended by org.sormula.operation.aggregate.SelectAggregateOperation<R,T>
              extended by org.sormula.operation.aggregate.SelectCountOperation<R,T>
Type Parameters:
R - class type which contains members for columns of a row in a table
T - class type of aggregate result

public class SelectCountOperation<R,T>
extends SelectAggregateOperation<R,T>

SQL COUNT aggregate operation. See base class for details about use.

The data type returned from database is the same type as the expression. For example, if expression is a column, then the returned type is the same type as column. If expression is "*", then databases typically return a long.

Since:
1.1
Author:
Jeff Miller

Constructor Summary
SelectCountOperation(Table<R> table, java.lang.String expression)
          Constructs for standard sql select statement as:
SELECT COUNT(e), ...
 
Method Summary
 
Methods inherited from class org.sormula.operation.aggregate.SelectAggregateOperation
initBaseSql, readAggregate
 
Methods inherited from class org.sormula.operation.ScalarSelectOperation
close, execute, getMaximumRowsRead, getOrderByName, getOrderByTranslator, getResultSet, getRowsReadCount, getSql, isLazySelectsCascades, isNotifyLazySelects, postRead, postReadCascade, prepareCascades, preRead, preReadCascade, readNext, select, select, setMaximumRowsRead, setOrderBy, setOrderByTranslator, setParameters, setRowParameters
 
Methods inherited from class org.sormula.operation.SqlOperation
cancel, cascade, closeCascades, closeStatement, createTargetField, getBaseSql, getConnection, getCustomSql, getNextParameter, getOperationTime, getParameters, getPreparedSql, getPreparedStatement, getQueryTimeout, getTable, getTargetTable, getTimingId, getWhereConditionName, getWhereTranslator, initOperationTime, isAutoGeneratedKeys, isIncludeIdentityColumns, isReadOnly, isTimings, logTimings, prepare, prepareCascades, prepareCheck, prepareColumns, prepareParameters, prepareWhere, setAutoGeneratedKeys, setBaseSql, setCustomSql, setIncludeIdentityColumns, setNextParameter, setQueryTimeout, setReadOnly, setTimingId, setTimings, setWhere, setWhereTranslator, writeColumns, writeParameter, writeParameters, writeWhere
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectCountOperation

public SelectCountOperation(Table<R> table,
                            java.lang.String expression)
                     throws OperationException
Constructs for standard sql select statement as:
SELECT COUNT(e), ... FROM table
where e is a SQL expression (typically a column name).

Parameters:
table - select from this table
expression - expression to use as parameter to function; typically it is the name of a column to that aggregate function operates upon (example: COUNT(amount) amount is expression)
Throws:
OperationException - if error