接口 RecordExtractor<T>
public interface RecordExtractor<T>
Callback interface for extracting a result object from a CCI Record instance.Used for output object creation in CciTemplate. Alternatively, output Records can also be returned to client code as-is. In case of a CCI ResultSet as execution result, you will almost always want to implement a RecordExtractor, to be able to read the ResultSet in a managed fashion, with the CCI Connection still open while reading the ResultSet.
Implementations of this interface perform the actual work of extracting results, but don't need to worry about exception handling. ResourceExceptions will be caught and handled correctly by the CciTemplate class.
- 从以下版本开始:
- 1.2
- 作者:
- Thierry Templier, Juergen Hoeller
- 另请参阅:
CciTemplate.execute(javax.resource.cci.InteractionSpec, Record, RecordExtractor)
,CciTemplate.execute(javax.resource.cci.InteractionSpec, RecordCreator, RecordExtractor)
,ResultSet
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 T
extractData(Record record)
Process the data in the given Record, creating a corresponding result object.
方法详细资料
extractData
T extractData(Record record) throws ResourceException, SQLException, DataAccessException
Process the data in the given Record, creating a corresponding result object.- 参数:
record
- the Record to extract data from (possibly a CCI ResultSet)- 返回:
- an arbitrary result object, or
null
if none (the extractor will typically be stateful in the latter case) - 抛出:
ResourceException
- if thrown by a CCI method, to be auto-converted to a DataAccessExceptionSQLException
- if thrown by a ResultSet method, to be auto-converted to a DataAccessExceptionDataAccessException
- in case of custom exceptions- 另请参阅:
ResultSet