|
||||||||||
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.SelectOperation<R,C>
R
- class type which contains members for columns of a row in a tableC
- collection type returnedpublic abstract class SelectOperation<R,C>
SQL select operation returning a collection of rows.
Constructor Summary | |
---|---|
SelectOperation(Table<R> table)
Constructs standard sql to select by primary key as: SELECT c1, c2, c3, ... |
|
SelectOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs standard sql to by a where condition: SELECT c1, c2, c3, ... |
Method Summary | |
---|---|
protected abstract boolean |
add(R row)
Implement to add row to collection created createReadAllCollection() . |
protected abstract C |
createReadAllCollection()
Implement to create collection to use by readAll() . |
int |
getDefaultReadAllSize()
Gets the default size to allocate for Collection C by createReadAllCollection() . |
C |
getSelectedRows()
Gets collection of rows that were selected with readAll() . |
C |
readAll()
Reads all rows from current result set. |
C |
selectAll(java.lang.Object... parameters)
Set parameters, executes, reads all rows in result set, closes. |
C |
selectAll(R whereParameters)
Set parameters, executes, reads all rows in result set, closes. |
void |
setDefaultReadAllSize(int defaultReadAllSize)
Sets default initial capacity for collection that is to contain the selected rows. |
Methods inherited from class org.sormula.operation.ScalarSelectOperation |
---|
close, execute, getMaximumRowsRead, getOrderByName, getOrderByTranslator, getResultSet, getRowsReadCount, getSql, initBaseSql, isLazySelectsCascades, isNotifyLazySelects, postRead, postReadCascade, prepareCascades, preRead, preReadCascade, readNext, 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 SelectOperation(Table<R> table) throws OperationException
table
- select from this table
OperationException
- if errorpublic SelectOperation(Table<R> table, java.lang.String whereConditionName) throws OperationException
table
- select from 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 |
---|
public int getDefaultReadAllSize()
Collection
C by createReadAllCollection()
.
public void setDefaultReadAllSize(int defaultReadAllSize)
defaultReadAllSize
- initial collection capacity; default is 20public C readAll() throws OperationException
setDefaultReadAllSize(int)
may improve performance.
OperationException
- if errorpublic C getSelectedRows()
readAll()
.
readAll()
has not been invokedpublic C selectAll(java.lang.Object... parameters) throws OperationException
parameters
- query parameters as objects (see ScalarSelectOperation.setParameters(Object...)
)
readAll()
OperationException
- if errorpublic C selectAll(R whereParameters) throws OperationException
whereParameters
- query parameters are read from an existing row object
(see ScalarSelectOperation.setParameters(Object...)
)
readAll()
OperationException
- if errorprotected abstract C createReadAllCollection()
readAll()
.
readAll()
protected abstract boolean add(R row) throws OperationException
createReadAllCollection()
.
row
- row to add
OperationException
- if error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |