org.sormula.operation
Class LinkedHashMapSelectOperation<K,R>

java.lang.Object
  extended by org.sormula.operation.SqlOperation<R>
      extended by org.sormula.operation.ScalarSelectOperation<R>
          extended by org.sormula.operation.SelectOperation<R,java.util.Map<K,R>>
              extended by org.sormula.operation.MapSelectOperation<K,R>
                  extended by org.sormula.operation.LinkedHashMapSelectOperation<K,R>
Type Parameters:
K - key class type for row objects
R - Class associated with a row in table

public class LinkedHashMapSelectOperation<K,R>
extends MapSelectOperation<K,R>

MapSelectOperation that uses LinkedHashMap for SelectOperation.readAll() results. A LinkedHashMap allows you to order with ScalarSelectOperation.setOrderBy(String) so that the order is preserved in the resulting map and yet allow direct look up by primary key.

Since:
1.3
Author:
Jeff Miller

Constructor Summary
LinkedHashMapSelectOperation(Table<R> table)
          Constructs for a table.
LinkedHashMapSelectOperation(Table<R> table, java.lang.String whereConditionName)
          Constructs for a table and where condition.
 
Method Summary
protected  java.util.Map<K,R> createReadAllCollection()
          Creates an LinkedHashMap to contain selected rows.
 
Methods inherited from class org.sormula.operation.MapSelectOperation
add, getGetKeyMethod, getGetKeyMethodName, getKey, prepare, setGetKeyMethod, setGetKeyMethodName
 
Methods inherited from class org.sormula.operation.SelectOperation
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 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, 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

LinkedHashMapSelectOperation

public LinkedHashMapSelectOperation(Table<R> table)
                             throws OperationException
Constructs for a table.

Parameters:
table - select from this table
Throws:
OperationException - if error

LinkedHashMapSelectOperation

public LinkedHashMapSelectOperation(Table<R> table,
                                    java.lang.String whereConditionName)
                             throws OperationException
Constructs for a table and where condition.

Parameters:
table - select from this table
whereConditionName - name of where condition to use ("primaryKey" to select by primary key; empty string to select all rows in table)
Throws:
OperationException - if error
Method Detail

createReadAllCollection

protected java.util.Map<K,R> createReadAllCollection()
Creates an LinkedHashMap to contain selected rows.

Specified by:
createReadAllCollection in class SelectOperation<R,java.util.Map<K,R>>
Returns:
new LinkedHashMap