Add comprehensive tests of Kotlin extensions
This commit also removes extensions hidden by Java API (varargs).
This commit is contained in:
@@ -91,15 +91,6 @@ fun <T : Any> JdbcOperations.queryForObject(sql: String, requiredType: KClass<T>
|
||||
queryForObject(sql, requiredType.java, *args)
|
||||
|
||||
|
||||
/**
|
||||
* Extension for [JdbcOperations.queryForList] providing a [KClass] based variant.
|
||||
*
|
||||
* @author Mario Arias
|
||||
* @since 5.0
|
||||
*/
|
||||
fun <T : Any> JdbcOperations.queryForList(sql: String, elementType: KClass<T>): List<T> =
|
||||
queryForList(sql, elementType.java)
|
||||
|
||||
/**
|
||||
* Extension for [JdbcOperations.queryForList] providing a `queryForList<Foo>("...")` variant.
|
||||
*
|
||||
@@ -110,15 +101,6 @@ fun <T : Any> JdbcOperations.queryForList(sql: String, elementType: KClass<T>):
|
||||
inline fun <reified T : Any> JdbcOperations.queryForList(sql: String): List<T> =
|
||||
queryForList(sql, T::class.java)
|
||||
|
||||
/**
|
||||
* Extension for [JdbcOperations.queryForList] providing a [KClass] based variant.
|
||||
*
|
||||
* @author Mario Arias
|
||||
* @since 5.0
|
||||
*/
|
||||
fun <T : Any> JdbcOperations.queryForList(sql: String, args: Array<out Any>, argTypes: IntArray, elementType: KClass<T>): List<T> =
|
||||
queryForList(sql, args, argTypes, elementType.java)
|
||||
|
||||
/**
|
||||
* Extension for [JdbcOperations.queryForList] providing a `queryForList<Foo>("...", arrayOf(arg1, argN), intArray(type1, typeN))` variant
|
||||
*
|
||||
@@ -129,15 +111,6 @@ fun <T : Any> JdbcOperations.queryForList(sql: String, args: Array<out Any>, arg
|
||||
inline fun <reified T : Any> JdbcOperations.queryForList(sql: String, args: Array<out Any>, argTypes: IntArray): List<T> =
|
||||
queryForList(sql, args, argTypes, T::class.java)
|
||||
|
||||
/**
|
||||
* Extension for [JdbcOperations.queryForList] providing a [KClass] based variant.
|
||||
*
|
||||
* @author Mario Arias
|
||||
* @since 5.0
|
||||
*/
|
||||
fun <T : Any> JdbcOperations.queryForList(sql: String, args: Array<out Any>, elementType: KClass<T>): List<T> =
|
||||
queryForList(sql, args, elementType.java)
|
||||
|
||||
/**
|
||||
* Extension for [JdbcOperations.queryForList] providing a `queryForList<Foo>("...", arrayOf(arg1, argN))` variant
|
||||
*
|
||||
@@ -174,4 +147,3 @@ fun JdbcOperations.query(sql: String, vararg args: Any, function: (ResultSet) ->
|
||||
*/
|
||||
fun <T : Any> JdbcOperations.query(sql: String, vararg args: Any, function: (ResultSet, Int) -> T): List<T> =
|
||||
query(sql, RowMapper { rs, i -> function(rs, i) }, *args)
|
||||
|
||||
|
||||
@@ -56,4 +56,4 @@ operator fun MapSqlParameterSource.set(paramName: String, sqlType: Int, value: A
|
||||
*/
|
||||
operator fun MapSqlParameterSource.set(paramName: String, sqlType: Int, typeName: String, value: Any) {
|
||||
this.addValue(paramName, value, sqlType, typeName)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user