|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sormula.operation.SqlOperation<R> org.sormula.operation.ScalarSelectOperation<R> org.sormula.operation.SelectCountOperation<R>
R
- class type which contains members for columns of a row in a tablepublic class SelectCountOperation<R>
SQL select count of records operation. By default selects count of all rows
in table. Set where condition with SqlOperation.setWhere(String)
to count subset of all rows.
This class remains in this package for backward compatibility. org.sormula.operation.aggregate contains a replacement for this class and it contains other aggregate operations.
SelectCountOperation
Constructor Summary | |
---|---|
SelectCountOperation(Table<R> table)
Constructs standard sql select by primary key as: SELECT COUNT(*), ... |
|
SelectCountOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs standard sql select as: SELECT COUNT(*), ... |
Method Summary | |
---|---|
protected void |
initBaseSql()
Sets base sql with SqlOperation.setBaseSql(String) . |
java.lang.Integer |
readCount()
Reads the count of rows. |
R |
readNext()
Use readCount() instead. |
Methods inherited from class org.sormula.operation.ScalarSelectOperation |
---|
close, execute, getMaximumRowsRead, getOrderByName, getOrderByTranslator, getResultSet, getRowsReadCount, getSql, isLazySelectsCascades, isNotifyLazySelects, postRead, postReadCascade, prepareCascades, preRead, preReadCascade, select, select, setMaximumRowsRead, setOrderBy, setOrderByTranslator, setParameters, setRowParameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SelectCountOperation(Table<R> table) throws OperationException
table
- insert into this table
OperationException
- if errorpublic SelectCountOperation(Table<R> table, java.lang.String whereConditionName) throws OperationException
table
- insert into this tablewhereConditionName
- name of where condition to use ("primaryKey" to select
by primary key; empty string to select all rows in table)
OperationException
- if errorMethod Detail |
---|
protected void initBaseSql()
SqlOperation.setBaseSql(String)
.
initBaseSql
in class ScalarSelectOperation<R>
public R readNext() throws OperationException
readCount()
instead. R class rows are not returned from select count(*).
readNext
in class ScalarSelectOperation<R>
OperationException
- for all invocationspublic java.lang.Integer readCount() throws OperationException
ScalarSelectOperation.execute()
prior to using this method.
OperationException
- if error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |