|
||||||||||
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,java.util.Map<K,R>> org.sormula.operation.MapSelectOperation<K,R>
K
- key class type for rowR
- Class associated with a row in tablepublic abstract class MapSelectOperation<K,R>
SelectOperation
that uses Map
for SelectOperation.readAll()
results.
Constructor Summary | |
---|---|
MapSelectOperation(Table<R> table)
Constructs for a table. |
|
MapSelectOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs for a table and where condition. |
Method Summary | |
---|---|
protected boolean |
add(R row)
Implement to add row to collection created SelectOperation.createReadAllCollection() . |
java.lang.reflect.Method |
getGetKeyMethod()
Gets the method of class R that obtains key of type K from a row. |
java.lang.String |
getGetKeyMethodName()
Return the name of the get key method. |
protected K |
getKey(R row)
Gets key for row. |
protected void |
prepare()
Creates prepared statement for this operation and invokes SqlOperation.prepareCascades()
to prepare statements for any cascade operations. |
void |
setGetKeyMethod(java.lang.reflect.Method getKeyMethod)
Sets the get key method. |
void |
setGetKeyMethodName(java.lang.String getKeyMethodName)
Sets the get key method. |
Methods inherited from class org.sormula.operation.SelectOperation |
---|
createReadAllCollection, getDefaultReadAllSize, getSelectedRows, readAll, selectAll, selectAll, setDefaultReadAllSize |
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 MapSelectOperation(Table<R> table) throws OperationException
table
- select from this table
OperationException
- if errorpublic MapSelectOperation(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 java.lang.reflect.Method getGetKeyMethod()
add(Object)
to add a row to the map.
Object.hashCode()
public void setGetKeyMethod(java.lang.reflect.Method getKeyMethod)
getGetKeyMethod()
for details. The default
is Object.hashCode()
. Use this method or setGetKeyMethodName(String)
to define
the get key method or override getKey(Object)
.
getKeyMethod
- row method that gets map keypublic void setGetKeyMethodName(java.lang.String getKeyMethodName) throws OperationException
getGetKeyMethod()
for details. The default
is Object.hashCode()
. Use this method or setGetKeyMethod(Method)
to define the
get key method or override getKey(Object)
.
getKeyMethodName
- name of row method to get map key
OperationException
- if errorpublic java.lang.String getGetKeyMethodName()
protected void prepare() throws OperationException
SqlOperation.prepareCascades()
to prepare statements for any cascade operations.
prepare
in class SqlOperation<R>
OperationException
- if errorprotected boolean add(R row) throws OperationException
SelectOperation.createReadAllCollection()
.
add
in class SelectOperation<R,java.util.Map<K,R>>
row
- row to add
OperationException
- if errorprotected K getKey(R row) throws OperationException
row
- row object
OperationException
- if error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |