| 程序包 | 说明 |
|---|---|
| net.hasor.db.jdbc |
数据库操作框架,前身为 SpringJDBC。
|
| net.hasor.db.jdbc.core |
Hasor Jdbc Operations Impl.
|
| net.hasor.db.jdbc.paramer |
提供了一些有用的
SqlParameterSource接口实现。 |
| 限定符和类型 | 方法和说明 |
|---|---|
<T> T |
JdbcOperations.execute(String sql,
SqlParameterSource paramSource,
PreparedStatementCallback<T> action)
执行一个 JDBC 操作。
|
int[] |
JdbcOperations.executeBatch(String sql,
SqlParameterSource[] batchArgs)
批量执行 insert 或 update、delete 语句,这一批次中的SQL 参数使用 BatchPreparedStatementSetter 接口设置。
|
int |
JdbcOperations.executeUpdate(String sql,
SqlParameterSource paramSource)
执行一个更新语句(insert、update、delete),这个查询将会使用 PreparedStatement 接口操作。
|
<T> T |
JdbcOperations.query(String sql,
SqlParameterSource paramSource,
ResultSetExtractor<T> rse)
查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作,并且将 SQL 查询结果集使用 ResultSetExtractor 转换。
|
void |
JdbcOperations.query(String sql,
SqlParameterSource paramSource,
RowCallbackHandler rch)
查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作,并且结果集行处理使用 RowCallbackHandler 接口处理。
|
<T> List<T> |
JdbcOperations.query(String sql,
SqlParameterSource paramSource,
RowMapper<T> rowMapper)
查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作。
|
int |
JdbcOperations.queryForInt(String sql,
SqlParameterSource paramSource)
查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作。
|
List<Map<String,Object>> |
JdbcOperations.queryForList(String sql,
SqlParameterSource paramSource)
查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作。
|
<T> List<T> |
JdbcOperations.queryForList(String sql,
SqlParameterSource paramSource,
Class<T> elementType)
查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作。
|
long |
JdbcOperations.queryForLong(String sql,
SqlParameterSource paramSource)
查询一个 SQL 语句,sql 参数通过 SqlParameterSource 封装。
|
Map<String,Object> |
JdbcOperations.queryForMap(String sql,
SqlParameterSource paramSource)
查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作。
|
<T> T |
JdbcOperations.queryForObject(String sql,
SqlParameterSource paramSource,
Class<T> requiredType)
查询一个 SQL 语句,查询参数使用 SqlParameterSource 封装,并将查询结果使用 requiredType 参数表示的类型返回。
|
<T> T |
JdbcOperations.queryForObject(String sql,
SqlParameterSource paramSource,
RowMapper<T> rowMapper)
查询一个 SQL 语句,查询参数使用 SqlParameterSource 封装。
|
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
ParsedSql.buildSql(ParsedSql parsedSql,
SqlParameterSource paramSource)
生成SQL
|
static Object[] |
ParsedSql.buildSqlValues(ParsedSql parsedSql,
SqlParameterSource paramSource)
生成Values
|
<T> T |
JdbcTemplate.execute(String sql,
SqlParameterSource paramSource,
PreparedStatementCallback<T> action) |
int[] |
JdbcTemplate.executeBatch(String sql,
SqlParameterSource[] batchArgs) |
int |
JdbcTemplate.executeUpdate(String sql,
SqlParameterSource paramSource) |
protected PreparedStatementCreator |
JdbcTemplate.getPreparedStatementCreator(String sql,
SqlParameterSource paramSource)
Build a PreparedStatementCreator based on the given SQL and named parameters.
|
<T> T |
JdbcTemplate.query(String sql,
SqlParameterSource paramSource,
ResultSetExtractor<T> rse) |
void |
JdbcTemplate.query(String sql,
SqlParameterSource paramSource,
RowCallbackHandler rch) |
<T> List<T> |
JdbcTemplate.query(String sql,
SqlParameterSource paramSource,
RowMapper<T> rowMapper) |
int |
JdbcTemplate.queryForInt(String sql,
SqlParameterSource paramSource) |
List<Map<String,Object>> |
JdbcTemplate.queryForList(String sql,
SqlParameterSource paramSource) |
<T> List<T> |
JdbcTemplate.queryForList(String sql,
SqlParameterSource paramSource,
Class<T> elementType) |
long |
JdbcTemplate.queryForLong(String sql,
SqlParameterSource paramSource) |
Map<String,Object> |
JdbcTemplate.queryForMap(String sql,
SqlParameterSource paramSource) |
<T> T |
JdbcTemplate.queryForObject(String sql,
SqlParameterSource paramSource,
Class<T> requiredType) |
<T> T |
JdbcTemplate.queryForObject(String sql,
SqlParameterSource paramSource,
RowMapper<T> rowMapper) |
| 限定符和类型 | 类和说明 |
|---|---|
class |
BeanSqlParameterSource |
class |
MapSqlParameterSource
一个 Map 到 SqlParameterSource 的桥,同时支持自动识别 Supplier 接口以获取具体参数。
|
Copyright © 2020. All rights reserved.