com.alexkasko.springjdbc.iterable
Interface IterableNamedParameterJdbcOperations

All Known Implementing Classes:
IterableNamedParameterJdbcTemplate

public interface IterableNamedParameterJdbcOperations

Extension interface for NamedParameterJdbcOperations. All methods, that return List mirrored with queryForIter methods that return CloseableIterator. Javadocs borrowed from NamedParameterJdbcOperations.

Author:
alexkasko Date: 11/7/12

Method Summary
 IterableJdbcOperations getIterableJdbcOperations()
          Expose IterableJdbcTemplate to allow queries without named parameters
 CloseableIterator<Map<String,Object>> queryForIter(String sql, Map<String,?> paramMap)
          Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
<T> CloseableIterator<T>
queryForIter(String sql, Map<String,?> paramMap, Class<T> elementType)
          Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
<T> CloseableIterator<T>
queryForIter(String sql, Map<String,?> paramMap, org.springframework.jdbc.core.RowMapper<T> rowMapper)
          Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
 CloseableIterator<Map<String,Object>> queryForIter(String sql, org.springframework.jdbc.core.namedparam.SqlParameterSource paramSource)
          Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
<T> CloseableIterator<T>
queryForIter(String sql, org.springframework.jdbc.core.namedparam.SqlParameterSource paramSource, Class<T> elementType)
          Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
<T> CloseableIterator<T>
queryForIter(String sql, org.springframework.jdbc.core.namedparam.SqlParameterSource paramSource, org.springframework.jdbc.core.RowMapper<T> rowMapper)
          Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
 

Method Detail

getIterableJdbcOperations

IterableJdbcOperations getIterableJdbcOperations()
Expose IterableJdbcTemplate to allow queries without named parameters


queryForIter

<T> CloseableIterator<T> queryForIter(String sql,
                                      org.springframework.jdbc.core.namedparam.SqlParameterSource paramSource,
                                      org.springframework.jdbc.core.RowMapper<T> rowMapper)
                                  throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
rowMapper - object that will map one object per row
Returns:
the result Iterator, containing mapped objects
Throws:
org.springframework.dao.DataAccessException - if the query fails

queryForIter

<T> CloseableIterator<T> queryForIter(String sql,
                                      Map<String,?> paramMap,
                                      org.springframework.jdbc.core.RowMapper<T> rowMapper)
                                  throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
rowMapper - object that will map one object per row
Returns:
the result Iterator, containing mapped objects
Throws:
org.springframework.dao.DataAccessException - if the query fails

queryForIter

<T> CloseableIterator<T> queryForIter(String sql,
                                      org.springframework.jdbc.core.namedparam.SqlParameterSource paramSource,
                                      Class<T> elementType)
                                  throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.

Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
elementType - the required type of element in the result list (for example, Integer.class)
Returns:
an Iterator of objects that match the specified element type
Throws:
org.springframework.dao.DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForList(String, Class), SingleColumnRowMapper

queryForIter

<T> CloseableIterator<T> queryForIter(String sql,
                                      Map<String,?> paramMap,
                                      Class<T> elementType)
                                  throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.

Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
elementType - the required type of element in the result list (for example, Integer.class)
Returns:
an Iterator of objects that match the specified element type
Throws:
org.springframework.dao.DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForList(String, Class), SingleColumnRowMapper

queryForIter

CloseableIterator<Map<String,Object>> queryForIter(String sql,
                                                   org.springframework.jdbc.core.namedparam.SqlParameterSource paramSource)
                                                   throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of Maps (one entry for each column, using the column name as the key). Thus Each element in the list will be of the form returned by this interface's queryForMap() methods.

Parameters:
sql - SQL query to execute
paramSource - container of arguments to bind to the query
Returns:
an Iterator that contains a Map per row
Throws:
org.springframework.dao.DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForList(String)

queryForIter

CloseableIterator<Map<String,Object>> queryForIter(String sql,
                                                   Map<String,?> paramMap)
                                                   throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of Maps (one entry for each column, using the column name as the key). Each element in the list will be of the form returned by this interface's queryForMap() methods.

Parameters:
sql - SQL query to execute
paramMap - map of parameters to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type)
Returns:
an Iterator that contains a Map per row
Throws:
org.springframework.dao.DataAccessException - if the query fails
See Also:
JdbcTemplate.queryForList(String)


Copyright © 2013. All Rights Reserved.