open class ArgumentPreparedStatementSetter : PreparedStatementSetter, ParameterDisposer
Simple adapter for PreparedStatementSetter that applies a given array of arguments. |
|
open class ArgumentTypePreparedStatementSetter : PreparedStatementSetter, ParameterDisposer
Simple adapter for PreparedStatementSetter that applies given arrays of arguments and JDBC argument types. |
|
abstract class BatchUpdateUtils
Generic utility methods for working with JDBC batch statements. Mainly for internal use within the framework. |
|
open class BeanPropertyRowMapper<T : Any> : RowMapper<T>
RowMapper implementation that converts a row into a new instance of the specified mapped target class. The mapped target class must be a top-level class and it must have a default or no-arg constructor. Column values are mapped based on matching the column name as obtained from result set metadata to public setters for the corresponding properties. The names are matched either directly or by transforming a name separating the parts with underscores to the same name using "camel" case. Mapping is provided for fields in the target class for many common types, e.g.: String, boolean, Boolean, byte, Byte, short, Short, int, Integer, long, Long, float, Float, double, Double, BigDecimal, To facilitate mapping between columns and fields that don't have matching names, try using column aliases in the SQL statement like "select fname as first_name from customer". For 'null' values read from the database, we will attempt to call the setter, but in the case of Java primitives, this causes a TypeMismatchException. This class can be configured (using the primitivesDefaultedForNullValue property) to trap this exception and use the primitives default value. Be aware that if you use the values from the generated bean to update the database the primitive value will have been set to the primitive's default value instead of null. Please note that this class is designed to provide convenience rather than high performance. For best performance, consider using a custom RowMapper implementation. |
|
open class CallableStatementCreatorFactory
Helper class that efficiently creates multiple CallableStatementCreator objects with different parameters based on a SQL statement and a single set of parameter declarations. |
|
open class ColumnMapRowMapper : RowMapper<MutableMap<String, Any>>
RowMapper implementation that creates a The Map implementation to use and the key to use for each column in the column Map can be customized through overriding Note: By default, ColumnMapRowMapper will try to build a linked Map with case-insensitive keys, to preserve column order as well as allow any casing to be used for column names. This requires Commons Collections on the classpath (which will be autodetected). Else, the fallback is a standard linked HashMap, which will still preserve column order but requires the application to specify the column names in the same casing as exposed by the driver. |
|
open class PreparedStatementCreatorFactory
Helper class that efficiently creates multiple PreparedStatementCreator objects with different parameters based on a SQL statement and a single set of parameter declarations. |
|
open class ResultSetSupportingSqlParameter : SqlParameter
Common base class for ResultSet-supporting SqlParameters like SqlOutParameter and SqlReturnResultSet. |
|
open class RowCountCallbackHandler : RowCallbackHandler
Implementation of RowCallbackHandler. Convenient superclass for callback handlers. An instance can only be used once. We can either use this on its own (for example, in a test case, to ensure that our result sets have valid dimensions), or use it as a superclass for callback handlers that actually do something, and will benefit from the dimension information it provides. A usage example with JdbcTemplate:
|
|
open class RowMapperResultSetExtractor<T : Any> : ResultSetExtractor<MutableList<T>>
Adapter implementation of the ResultSetExtractor interface that delegates to a RowMapper which is supposed to create an object for each row. Each object is added to the results List of this ResultSetExtractor. Useful for the typical case of one object per row in the database table. The number of entries in the results list will match the number of rows. Note that a RowMapper object is typically stateless and thus reusable; just the RowMapperResultSetExtractor adapter is stateful. A usage example with JdbcTemplate:
Alternatively, consider subclassing MappingSqlQuery from the |
|
open class SingleColumnRowMapper<T : Any> : RowMapper<T>
RowMapper implementation that converts a single column into a single result value per row. Expects to operate on a The type of the result value for each row can be specified. The value for the single column will be extracted from the |
|
open class SqlInOutParameter : SqlOutParameter
Subclass of SqlOutParameter to represent an INOUT parameter. Will return Output parameters - like all stored procedure parameters - must have names. |
|
open class SqlOutParameter : ResultSetSupportingSqlParameter
Subclass of SqlParameter to represent an output parameter. No additional properties: instanceof will be used to check for such types. Output parameters - like all stored procedure parameters - must have names. |
|
open class SqlParameterValue : SqlParameter
Object to represent a SQL parameter value, including parameter metadata such as the SQL type and the scale for numeric values. Designed for use with JdbcTemplate's operations that take an array of argument values: Each such argument value may be a |
|
interface SqlProvider
Interface to be implemented by objects that can provide SQL strings. Typically implemented by PreparedStatementCreators, CallableStatementCreators and StatementCallbacks that want to expose the SQL they use to create their statements, to allow for better contextual information in case of exceptions. |
|
open class SqlReturnUpdateCount : SqlParameter
Represents a returned update count from a stored procedure call. Returned update counts - like all stored procedure parameters - must have names. |
|
open class SqlRowSetResultSetExtractor : ResultSetExtractor<SqlRowSet>
ResultSetExtractor implementation that returns a Spring SqlRowSet representation for each given ResultSet. The default implementation uses a standard JDBC CachedRowSet underneath. |
|
abstract class StatementCreatorUtils
Utility methods for PreparedStatementSetter/Creator and CallableStatementCreator implementations, providing sophisticated parameter management (including support for LOB values). Used by PreparedStatementCreatorFactory and CallableStatementCreatorFactory, but also available for direct use in custom setter/creator implementations. |
fun <T : Any> JdbcOperations.query(sql: String, vararg args: Any, function: (ResultSet) -> T): T?
Extension for JdbcOperations.query providing a ResultSetExtractor-like function
variant: fun JdbcOperations.query(sql: String, vararg args: Any, function: (ResultSet) -> Unit): Unit
Extension for JdbcOperations.query providing a RowCallbackHandler-like function
variant: fun <T : Any> JdbcOperations.query(sql: String, vararg args: Any, function: (ResultSet, Int) -> T): List<T>
Extensions for JdbcOperations.query providing a RowMapper-like function variant:
|
|
fun <T : Any> JdbcOperations.queryForList(sql: String): List<T>
Extension for JdbcOperations.queryForList providing a fun <T : Any> JdbcOperations.queryForList(sql: String, args: Array<out Any>, argTypes: IntArray): List<T>
Extension for JdbcOperations.queryForList providing a
fun <T : Any> JdbcOperations.queryForList(sql: String, args: Array<out Any>): List<T>
Extension for JdbcOperations.queryForList providing a
|
|
fun <T : Any> JdbcOperations.queryForObject(sql: String): T?
Extension for JdbcOperations.queryForObject providing a fun <T : Any> JdbcOperations.queryForObject(sql: String, vararg args: Any, function: (ResultSet, Int) -> T): T?
Extensions for JdbcOperations.queryForObject providing a RowMapper-like function
variant: fun <T : Any> JdbcOperations.queryForObject(sql: String, args: Array<out Any>, argTypes: IntArray): T?
Extension for JdbcOperations.queryForObject providing a
fun <T : Any> JdbcOperations.queryForObject(sql: String, args: Array<out Any>): T?
Extension for JdbcOperations.queryForObject providing a
|