com.alexkasko.springjdbc.parallel.RowMapperFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of parallel-queries Show documentation
Show all versions of parallel-queries Show documentation
Processes given SQL query in parallel in multiple data sources (assuming that all data source
contain the same data). Combined results from multiple queries are exposed to application as
java.util.Iterator. Worker thread use spring's JdbcTemplate with named parameters support.
package com.alexkasko.springjdbc.parallel;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
/**
* Spring's row mappers haven't access to query params.
* This class may be used if such access is needed on result set mapping.
*
* @author alexkasko
* Date: 8/18/12
* @see ParallelQueriesIterator
*/
public interface RowMapperFactory {
/**
* Must produce row mapper. Will be called by {@link ParallelQueriesIterator} before every SQL query
*
* @param params query params
* @return row mapper for query results
*/
RowMapper produce(P params);
}