K
- key class type for row objectsR
- Class associated with a row in tablepublic 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.Constructor and Description |
---|
LinkedHashMapSelectOperation(Table<R> table)
Constructs for a table to use primary key where condition.
|
LinkedHashMapSelectOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs for a table and where condition.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<K,R> |
createReadAllCollection()
Creates an
LinkedHashMap to contain selected rows. |
add, getGetKeyMethodName, getKey, getKeyFunction, prepare, setGetKeyMethodName, setKeyFunction
getDefaultReadAllSize, getFetchSize, getResultSetType, getSelectedRows, prepareStatement, readAll, selectAll, selectAll, setDefaultReadAllSize, setFetchSize, setResultSetType, setWhere
addFilter, close, execute, getFilterPredicateMap, getMaximumRowsRead, getOrderByName, getOrderByTranslator, getResultSet, getRowsReadCount, getSql, initBaseSql, isExecuted, isLazySelectsCascades, isNotifyLazySelects, iterator, positionAbsolute, positionRelative, postRead, postReadCascade, prepareCascades, preRead, preReadCascade, readNext, removeFilter, resetRowsReadCount, select, select, setFilterPredicateMap, setMaximumRowsRead, setOrderBy, setOrderByTranslator, setParameters, setRowParameters, updateActiveFilterPredicate
cancel, cascade, closeCascades, closeStatement, createRowField, getBaseSql, getCascadeDepth, getConnection, getCustomSql, getNamedParameterMap, getNextParameter, getOperationTime, getParameter, getParameters, getPreparedSql, getPreparedStatement, getQueryTimeout, getRequiredCascades, getTable, getTargetTable, getTimingId, getWhereAnnotation, getWhereConditionName, getWhereTranslator, initOperationTime, isCached, isCascade, isCascading, isIncludeIdentityColumns, isPrimaryKey, isReadOnly, isRequiredCascade, isTimings, logTimings, prepareCascades, prepareCheck, setBaseSql, setCached, setCascade, setCascadeDepth, setCustomSql, setIncludeIdentityColumns, setNamedParameterMap, setNextParameter, setParameter, setQueryTimeout, setReadOnly, setRequiredCascades, setTimingId, setTimings, setWhereTranslator, writeColumns, writeParameter, writeParameters, writeWhere
public LinkedHashMapSelectOperation(Table<R> table) throws OperationException
SqlOperation
classes.
It is unlikely that you will want to use this constructor without also
changing the where condition since at most one row will be selected. Use
SelectOperation.setWhere(String)
or SqlOperation.setWhereTranslator(org.sormula.translator.AbstractWhereTranslator)
to change the default primary key where condition.
table
- select from this tableOperationException
- if errorpublic LinkedHashMapSelectOperation(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 errorprotected java.util.Map<K,R> createReadAllCollection()
LinkedHashMap
to contain selected rows.createReadAllCollection
in class SelectOperation<R,java.util.Map<K,R>>
LinkedHashMap