public class DbReader<ResultType>
extends net.idea.modbcum.p.batch.AbstractBatchProcessor<net.idea.modbcum.i.IQueryRetrieval<ResultType>,ResultType>
implements net.idea.modbcum.i.IDBProcessor<net.idea.modbcum.i.IQueryRetrieval<ResultType>,net.idea.modbcum.i.batch.IBatchStatistics>
Modifier and Type | Class and Description |
---|---|
protected static class |
DbReader.cached_results |
Modifier and Type | Field and Description |
---|---|
protected QueryExecutor<net.idea.modbcum.i.IQueryObject<ResultType>> |
executor |
protected boolean |
handlePrescreen |
protected ResultSet |
resultSet |
Constructor and Description |
---|
DbReader() |
Modifier and Type | Method and Description |
---|---|
void |
afterProcessing(net.idea.modbcum.i.IQueryRetrieval<ResultType> target,
Iterator<ResultType> iterator) |
void |
beforeProcessing(net.idea.modbcum.i.IQueryRetrieval<ResultType> target) |
protected void |
cache(String category,
String key,
ResultType object,
boolean ok)
Does nothing, otherwise should cache the query result
|
void |
close() |
protected DbReader.cached_results |
getCached(String category,
String key,
ResultType object)
Returns cached query results or NOTCACHED if not in the cache.
|
Iterator<ResultType> |
getIterator(net.idea.modbcum.i.IQueryRetrieval<ResultType> query) |
protected ResultSet |
getResultSet() |
boolean |
isHandlePrescreen() |
protected boolean |
prescreen(net.idea.modbcum.i.IQueryRetrieval<ResultType> query,
ResultType object) |
void |
setHandlePrescreen(boolean handlePrescreen) |
void |
setResultSet(ResultSet resultSet) |
cancel, getProcessorChain, getResult, getSilentInterval, getTimeout, onError, onItemProcessed, onItemProcessing, onItemRead, onItemSkipped, open, process, setConnection, setProcessorChain, setTimeout, skip
getConnection, isCloseConnection, isEnabled, setCloseConnection
addPropertyChangeListener, addPropertyChangeListener, getID, removePropertyChangeListener, removePropertyChangeListener, setEnabled, toString
protected ResultSet resultSet
protected QueryExecutor<net.idea.modbcum.i.IQueryObject<ResultType>> executor
protected boolean handlePrescreen
public boolean isHandlePrescreen()
public void setHandlePrescreen(boolean handlePrescreen)
protected DbReader.cached_results getCached(String category, String key, ResultType object)
query_effectrecord
- object
- protected void cache(String category, String key, ResultType object, boolean ok)
query_effectrecord
- object
- protected boolean prescreen(net.idea.modbcum.i.IQueryRetrieval<ResultType> query, ResultType object) throws net.idea.modbcum.i.exceptions.AmbitException
query
- object
- net.idea.modbcum.i.exceptions.AmbitException
public Iterator<ResultType> getIterator(net.idea.modbcum.i.IQueryRetrieval<ResultType> query) throws net.idea.modbcum.i.exceptions.AmbitException
getIterator
in interface net.idea.modbcum.i.processors.IBatchProcessor<net.idea.modbcum.i.IQueryRetrieval<ResultType>,ResultType,net.idea.modbcum.i.batch.IBatchStatistics>
net.idea.modbcum.i.exceptions.AmbitException
public void beforeProcessing(net.idea.modbcum.i.IQueryRetrieval<ResultType> target) throws net.idea.modbcum.i.exceptions.AmbitException
beforeProcessing
in interface net.idea.modbcum.i.processors.IBatchProcessor<net.idea.modbcum.i.IQueryRetrieval<ResultType>,ResultType,net.idea.modbcum.i.batch.IBatchStatistics>
beforeProcessing
in class net.idea.modbcum.p.batch.AbstractBatchProcessor<net.idea.modbcum.i.IQueryRetrieval<ResultType>,ResultType>
net.idea.modbcum.i.exceptions.AmbitException
public void afterProcessing(net.idea.modbcum.i.IQueryRetrieval<ResultType> target, Iterator<ResultType> iterator) throws net.idea.modbcum.i.exceptions.AmbitException
afterProcessing
in interface net.idea.modbcum.i.processors.IBatchProcessor<net.idea.modbcum.i.IQueryRetrieval<ResultType>,ResultType,net.idea.modbcum.i.batch.IBatchStatistics>
afterProcessing
in class net.idea.modbcum.p.batch.AbstractBatchProcessor<net.idea.modbcum.i.IQueryRetrieval<ResultType>,ResultType>
net.idea.modbcum.i.exceptions.AmbitException
public void close() throws Exception
close
in interface net.idea.modbcum.i.processors.IProcessor<net.idea.modbcum.i.IQueryRetrieval<ResultType>,net.idea.modbcum.i.batch.IBatchStatistics>
close
in class net.idea.modbcum.p.batch.AbstractBatchProcessor<net.idea.modbcum.i.IQueryRetrieval<ResultType>,ResultType>
Exception
protected ResultSet getResultSet()
public void setResultSet(ResultSet resultSet)
Copyright © 2004–2020 Ideaconsult Ltd.. All rights reserved.