org.springframework.batch.item.database
Class IbatisDrivingQueryItemReader

java.lang.Object
  extended by org.springframework.batch.item.database.DrivingQueryItemReader
      extended by org.springframework.batch.item.database.IbatisDrivingQueryItemReader
All Implemented Interfaces:
ItemReader, ItemStream, InitializingBean

public class IbatisDrivingQueryItemReader
extends DrivingQueryItemReader

Extension of DrivingQueryItemReader that maps keys to objects. An iBatis query id must be set to map and return each 'detail record'. The writer is thread safe after its properties are set (normal singleton behaviour).

Author:
Lucas Ward
See Also:
IbatisKeyCollector

Constructor Summary
IbatisDrivingQueryItemReader()
           
 
Method Summary
 Object read()
          Overridden read() that uses the returned key as arguments to the details query.
 void setDetailsQueryId(String detailsQueryId)
           
 void setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
          Set the SqlMapClientTemplate to use for this input source.
 
Methods inherited from class org.springframework.batch.item.database.DrivingQueryItemReader
afterPropertiesSet, close, getCurrentKey, mark, open, reset, setKeyCollector, setSaveState, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IbatisDrivingQueryItemReader

public IbatisDrivingQueryItemReader()
Method Detail

read

public Object read()
Overridden read() that uses the returned key as arguments to the details query.

Specified by:
read in interface ItemReader
Overrides:
read in class DrivingQueryItemReader
Returns:
next key in the list if not index is not at the last element, null otherwise.
See Also:
DrivingQueryItemReader.read()

setDetailsQueryId

public void setDetailsQueryId(String detailsQueryId)
Parameters:
detailsQueryId - id of the iBATIS select statement that will used to retrieve an object for a single primary key from the list returned by driving query

setSqlMapClient

public void setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
Set the SqlMapClientTemplate to use for this input source.

Parameters:
sqlMapClient -


Copyright © 2009 SpringSource. All Rights Reserved.