File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed
src/main/kotlin/org/mybatis/dynamic/sql/util/kotlin Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,18 @@ abstract class KotlinBaseBuilder<D : AbstractWhereSupport<*>> {
145
145
or (existsPredicate, sc)
146
146
}
147
147
148
+ /* *
149
+ * This function does nothing, but it can be used to make some code snippets more understandable.
150
+ *
151
+ * For example, to count all rows in a table you can write either of the following:
152
+ *
153
+ * val rows = countFrom(foo) { }
154
+ *
155
+ * or
156
+ *
157
+ * val rows = countFrom(foo) { allRows() }
158
+ */
159
+ @SuppressWarnings(" EmptyFunctionBlock" )
148
160
fun allRows () {}
149
161
150
162
private fun applyToWhere (block : AbstractWhereDSL <* >.() -> Unit ) {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2016-2021 the original author or authors.
2
+ * Copyright 2016-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ import kotlin.reflect.KClass
27
27
* This function preserves the non-nullable column type which is lost with the Java
28
28
* native versions.
29
29
*/
30
+ @SuppressWarnings(" LongParameterList" )
30
31
fun <T : Any > SqlTable.column (
31
32
name : String ,
32
33
jdbcType : JDBCType ? = null,
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2016-2021 the original author or authors.
2
+ * Copyright 2016-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -188,6 +188,7 @@ fun NamedParameterJdbcTemplate.selectOne(
188
188
this
189
189
)
190
190
191
+ @SuppressWarnings(" SwallowedException" )
191
192
fun <T > NamedParameterJdbcTemplate.selectOne (
192
193
selectStatement : SelectStatementProvider ,
193
194
rowMapper : (rs: ResultSet , rowNum: Int ) -> T
@@ -197,6 +198,7 @@ fun <T> NamedParameterJdbcTemplate.selectOne(
197
198
null
198
199
}
199
200
201
+ @SuppressWarnings(" SwallowedException" )
200
202
fun <T : Any > NamedParameterJdbcTemplate.selectOne (
201
203
selectStatement : SelectStatementProvider ,
202
204
type : KClass <T >
You can’t perform that action at this time.
0 commit comments