接口的使用
org.springframework.jdbc.core.RowMapper
使用RowMapper的程序包 程序包 说明 org.springframework.jdbc.core Provides the core JDBC framework, based on JdbcTemplate and its associated callback interfaces and helper objects.org.springframework.jdbc.core.metadata Context metadata abstraction for the configuration and execution of table inserts and stored procedure calls.org.springframework.jdbc.core.namedparam JdbcTemplate variant with named parameter support.org.springframework.jdbc.core.simple Simplification layer for table inserts and stored procedure calls.org.springframework.jdbc.object The classes in this package represent RDBMS queries, updates, and stored procedures as threadsafe, reusable objects.org.springframework.jdbc.core中RowMapper的使用
实现RowMapper的org.springframework.jdbc.core中的类 修饰符和类型 类 说明 class
BeanPropertyRowMapper<T>
RowMapper
implementation that converts a row into a new instance of the specified mapped target class.class
ColumnMapRowMapper
RowMapper
implementation that creates ajava.util.Map
for each row, representing all columns as key-value pairs: one entry for each column, with the column name as key.class
SingleColumnRowMapper<T>
RowMapper
implementation that converts a single column into a single result value per row.返回RowMapper的org.springframework.jdbc.core中的方法 修饰符和类型 方法 说明 protected RowMapper<Map<String,Object>>
JdbcTemplate. getColumnMapRowMapper()
Create a new RowMapper for reading columns as key-value pairs.RowMapper<?>
ResultSetSupportingSqlParameter. getRowMapper()
Return the RowMapper held by this parameter, if any.protected <T> RowMapper<T>
JdbcTemplate. getSingleColumnRowMapper(Class<T> requiredType)
Create a new RowMapper for reading result objects from a single column.参数类型为RowMapper的org.springframework.jdbc.core中的方法 修饰符和类型 方法 说明 <T> List<T>
JdbcOperations. query(String sql, Object[] args, int[] argTypes, 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 result object via a RowMapper.<T> List<T>
JdbcOperations. query(String sql, Object[] args, 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 result object via a RowMapper.<T> List<T>
JdbcOperations. query(String sql, PreparedStatementSetter pss, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, mapping each row to a result object via a RowMapper.<T> List<T>
JdbcOperations. query(String sql, RowMapper<T> rowMapper)
Execute a query given static SQL, mapping each row to a result object via a RowMapper.<T> List<T>
JdbcOperations. query(String sql, RowMapper<T> rowMapper, Object... args)
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 result object via a RowMapper.<T> List<T>
JdbcOperations. query(PreparedStatementCreator psc, RowMapper<T> rowMapper)
Query using a prepared statement, mapping each row to a result object via a RowMapper.<T> List<T>
JdbcTemplate. query(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper)
<T> List<T>
JdbcTemplate. query(String sql, Object[] args, RowMapper<T> rowMapper)
<T> List<T>
JdbcTemplate. query(String sql, PreparedStatementSetter pss, RowMapper<T> rowMapper)
<T> List<T>
JdbcTemplate. query(String sql, RowMapper<T> rowMapper)
<T> List<T>
JdbcTemplate. query(String sql, RowMapper<T> rowMapper, Object... args)
<T> List<T>
JdbcTemplate. query(PreparedStatementCreator psc, RowMapper<T> rowMapper)
<T> T
JdbcOperations. queryForObject(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a result object via a RowMapper.<T> T
JdbcOperations. queryForObject(String sql, Object[] args, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a result object via a RowMapper.<T> T
JdbcOperations. queryForObject(String sql, RowMapper<T> rowMapper)
Execute a query given static SQL, mapping a single result row to a result object via a RowMapper.<T> T
JdbcOperations. queryForObject(String sql, RowMapper<T> rowMapper, Object... args)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a result object via a RowMapper.<T> T
JdbcTemplate. queryForObject(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper)
<T> T
JdbcTemplate. queryForObject(String sql, Object[] args, RowMapper<T> rowMapper)
<T> T
JdbcTemplate. queryForObject(String sql, RowMapper<T> rowMapper)
<T> T
JdbcTemplate. queryForObject(String sql, RowMapper<T> rowMapper, Object... args)
参数类型为RowMapper的org.springframework.jdbc.core中的构造器 构造器 说明 ResultSetSupportingSqlParameter(String name, int sqlType, RowMapper<?> rm)
Create a new ResultSetSupportingSqlParameter.RowMapperResultSetExtractor(RowMapper<T> rowMapper)
Create a new RowMapperResultSetExtractor.RowMapperResultSetExtractor(RowMapper<T> rowMapper, int rowsExpected)
Create a new RowMapperResultSetExtractor.SqlInOutParameter(String name, int sqlType, RowMapper<?> rm)
Create a new SqlInOutParameter.SqlOutParameter(String name, int sqlType, RowMapper<?> rm)
Create a new SqlOutParameter.SqlReturnResultSet(String name, RowMapper<?> mapper)
Create a new instance of theSqlReturnResultSet
class.org.springframework.jdbc.core.metadata中RowMapper的使用
参数类型为RowMapper的org.springframework.jdbc.core.metadata中的方法 修饰符和类型 方法 说明 SqlParameter
CallMetaDataContext. createReturnResultSetParameter(String parameterName, RowMapper<?> rowMapper)
Create a ReturnResultSetParameter/SqlOutParameter depending on the support provided by the JDBC driver used for the database in use.org.springframework.jdbc.core.namedparam中RowMapper的使用
参数类型为RowMapper的org.springframework.jdbc.core.namedparam中的方法 修饰符和类型 方法 说明 <T> List<T>
NamedParameterJdbcOperations. query(String sql, Map<String,?> paramMap, 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.<T> List<T>
NamedParameterJdbcOperations. query(String sql, SqlParameterSource paramSource, 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.<T> List<T>
NamedParameterJdbcOperations. query(String sql, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL, mapping each row to a Java object via a RowMapper.<T> List<T>
NamedParameterJdbcTemplate. query(String sql, Map<String,?> paramMap, RowMapper<T> rowMapper)
<T> List<T>
NamedParameterJdbcTemplate. query(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)
<T> List<T>
NamedParameterJdbcTemplate. query(String sql, RowMapper<T> rowMapper)
<T> T
NamedParameterJdbcOperations. queryForObject(String sql, Map<String,?> paramMap, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.<T> T
NamedParameterJdbcOperations. queryForObject(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.<T> T
NamedParameterJdbcTemplate. queryForObject(String sql, Map<String,?> paramMap, RowMapper<T> rowMapper)
<T> T
NamedParameterJdbcTemplate. queryForObject(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)
org.springframework.jdbc.core.simple中RowMapper的使用
参数类型为RowMapper的org.springframework.jdbc.core.simple中的方法 修饰符和类型 方法 说明 void
AbstractJdbcCall. addDeclaredRowMapper(String parameterName, RowMapper<?> rowMapper)
Add aRowMapper
for the specified parameter or column.SimpleJdbcCall
SimpleJdbcCall. returningResultSet(String parameterName, RowMapper<?> rowMapper)
SimpleJdbcCallOperations
SimpleJdbcCallOperations. returningResultSet(String parameterName, RowMapper<?> rowMapper)
Used to specify when a ResultSet is returned by the stored procedure and you want it mapped by aRowMapper
.org.springframework.jdbc.object中RowMapper的使用
实现RowMapper的org.springframework.jdbc.object中的类 修饰符和类型 类 说明 protected class
MappingSqlQueryWithParameters.RowMapperImpl
Implementation of RowMapper that calls the enclosing class'smapRow
method for each row.protected class
UpdatableSqlQuery.RowMapperImpl
Implementation of RowMapper that calls the enclosing class'supdateRow()
method for each row.返回RowMapper的org.springframework.jdbc.object中的方法 修饰符和类型 方法 说明 protected RowMapper<T>
GenericSqlQuery. newRowMapper(Object[] parameters, Map<?,?> context)
protected RowMapper<T>
MappingSqlQueryWithParameters. newRowMapper(Object[] parameters, Map<?,?> context)
Implementation of protected abstract method.protected abstract RowMapper<T>
SqlQuery. newRowMapper(Object[] parameters, Map<?,?> context)
Subclasses must implement this method to extract an object per row, to be returned by theexecute
method as an aggregatedList
.protected RowMapper<T>
UpdatableSqlQuery. newRowMapper(Object[] parameters, Map<?,?> context)
Implementation of the superclass template method.参数类型为RowMapper的org.springframework.jdbc.object中的方法 修饰符和类型 方法 说明 void
GenericSqlQuery. setRowMapper(RowMapper<T> rowMapper)
Set a specificRowMapper
instance to use for this query.类型变量类型为RowMapper的org.springframework.jdbc.object中的方法参数 修饰符和类型 方法 说明 void
GenericSqlQuery. setRowMapperClass(Class<? extends RowMapper> rowMapperClass)