switch (scanType) {
case PRIMARY_KEY: {
// perform a select operation
Operation op = session.getSelectOperation(domainTypeHandler.getStoreTable());
// set key values into the operation
index.operationSetKeys(context, op);
// set the expected columns into the operation
domainTypeHandler.operationGetValues(op);
// execute the select and get results
result = op.resultData();
break;
}
case INDEX_SCAN: {
storeIndex = index.getStoreIndex();
if (logger.isDetailEnabled()) logger.detail("Using index scan with index " + index.getIndexName());
IndexScanOperation op;
// perform an index scan operation
if (index.isMultiRange()) {
op = session.getIndexScanOperationMultiRange(storeIndex, domainTypeHandler.getStoreTable());
} else {
op = session.getIndexScanOperation(storeIndex, domainTypeHandler.getStoreTable());
}
// set the expected columns into the operation
domainTypeHandler.operationGetValues(op);
// set the bounds into the operation
index.operationSetBounds(context, op);
// set additional filter conditions
where.filterCmpValue(context, op);
// execute the scan and get results
result = op.resultData();
break;
}
case TABLE_SCAN: {
if (logger.isDetailEnabled()) logger.detail("Using table scan");
// perform a table scan operation
ScanOperation op = session.getTableScanOperation(domainTypeHandler.getStoreTable());
// set the expected columns into the operation
domainTypeHandler.operationGetValues(op);
// set the bounds into the operation
if (where != null) {
where.filterCmpValue(context, op);
}
// execute the scan and get results
result = op.resultData();
break;
}
case UNIQUE_KEY: {
storeIndex = index.getStoreIndex();
if (logger.isDetailEnabled()) logger.detail("Using unique lookup with index " + index.getIndexName());
// perform a unique lookup operation
IndexOperation op = session.getUniqueIndexOperation(storeIndex, domainTypeHandler.getStoreTable());
// set the keys of the indexName into the operation
where.operationEqual(context, op);
// set the expected columns into the operation
//domainTypeHandler.operationGetValuesExcept(op, indexName);
domainTypeHandler.operationGetValues(op);
// execute the select and get results
result = op.resultData();
break;
}
default:
session.failAutoTransaction();