Skip to content

Commit dccf148

Browse files
committed
Updates per Detekt
1 parent 0252054 commit dccf148

File tree

13 files changed

+249
-791
lines changed

13 files changed

+249
-791
lines changed

detekt-config.yml

Lines changed: 0 additions & 666 deletions
This file was deleted.

src/main/kotlin/org/mybatis/dynamic/sql/util/kotlin/KotlinQueryBuilder.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import org.mybatis.dynamic.sql.util.Buildable
2424

2525
typealias SelectCompleter = KotlinQueryBuilder.() -> Buildable<SelectModel>
2626

27+
@Suppress("TooManyFunctions")
2728
class KotlinQueryBuilder(private val dsl: QueryExpressionDSL<SelectModel>) :
2829
KotlinBaseJoiningBuilder<QueryExpressionDSL<SelectModel>,
2930
QueryExpressionDSL<SelectModel>.QueryExpressionWhereBuilder,

src/main/kotlin/org/mybatis/dynamic/sql/util/kotlin/mybatis3/MapperSupportFunctions.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
@file:Suppress("TooManyFunctions")
1617
package org.mybatis.dynamic.sql.util.kotlin.mybatis3
1718

1819
import org.mybatis.dynamic.sql.BasicColumn

src/main/kotlin/org/mybatis/dynamic/sql/util/kotlin/spring/NamedParameterJdbcTemplateExtensions.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
@file:Suppress("TooManyFunctions")
1617
package org.mybatis.dynamic.sql.util.kotlin.spring
1718

1819
import org.mybatis.dynamic.sql.BasicColumn

src/test/kotlin/examples/kotlin/mybatis3/canonical/AddressRecord.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@
1515
*/
1616
package examples.kotlin.mybatis3.canonical
1717

18-
data class AddressRecord(var id: Int? = null, var streetAddress: String? = null, var city: String? = null, var state: String? = null)
18+
data class AddressRecord(
19+
var id: Int? = null,
20+
var streetAddress: String? = null,
21+
var city: String? = null,
22+
var state: String? = null
23+
)

src/test/kotlin/examples/kotlin/mybatis3/canonical/PersonDynamicSqlSupport.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ object PersonDynamicSqlSupport {
2323
object Person : SqlTable("Person") {
2424
val id = column<Int>("id", JDBCType.INTEGER)
2525
val firstName = column<String>("first_name", JDBCType.VARCHAR)
26-
val lastName = column<LastName>("last_name", JDBCType.VARCHAR, "examples.kotlin.mybatis3.canonical.LastNameTypeHandler")
26+
val lastName =
27+
column<LastName>("last_name", JDBCType.VARCHAR, "examples.kotlin.mybatis3.canonical.LastNameTypeHandler")
2728
val birthDate = column<Date>("birth_date", JDBCType.DATE)
28-
val employed = column<Boolean>("employed", JDBCType.VARCHAR, "examples.kotlin.mybatis3.canonical.YesNoTypeHandler")
29+
val employed =
30+
column<Boolean>("employed", JDBCType.VARCHAR, "examples.kotlin.mybatis3.canonical.YesNoTypeHandler")
2931
val occupation = column<String>("occupation", JDBCType.VARCHAR)
3032
val addressId = column<Int>("address_id", JDBCType.INTEGER)
3133
}

src/test/kotlin/examples/kotlin/mybatis3/canonical/PersonMapper.kt

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@
1515
*/
1616
package examples.kotlin.mybatis3.canonical
1717

18-
import org.apache.ibatis.annotations.*
18+
import org.apache.ibatis.annotations.DeleteProvider
19+
import org.apache.ibatis.annotations.InsertProvider
20+
import org.apache.ibatis.annotations.Mapper
21+
import org.apache.ibatis.annotations.Result
22+
import org.apache.ibatis.annotations.ResultMap
23+
import org.apache.ibatis.annotations.Results
24+
import org.apache.ibatis.annotations.SelectProvider
25+
import org.apache.ibatis.annotations.UpdateProvider
1926
import org.apache.ibatis.type.JdbcType
2027
import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider
2128
import org.mybatis.dynamic.sql.insert.render.GeneralInsertStatementProvider
@@ -50,14 +57,26 @@ interface PersonMapper {
5057
fun insertMultiple(insertStatement: MultiRowInsertStatementProvider<PersonRecord>): Int
5158

5259
@SelectProvider(type = SqlProviderAdapter::class, method = "select")
53-
@Results(id = "PersonResult", value = [
54-
Result(column = "A_ID", property = "id", jdbcType = JdbcType.INTEGER, id = true),
55-
Result(column = "first_name", property = "firstName", jdbcType = JdbcType.VARCHAR),
56-
Result(column = "last_name", property = "lastName", jdbcType = JdbcType.VARCHAR, typeHandler = LastNameTypeHandler::class),
57-
Result(column = "birth_date", property = "birthDate", jdbcType = JdbcType.DATE),
58-
Result(column = "employed", property = "employed", jdbcType = JdbcType.VARCHAR, typeHandler = YesNoTypeHandler::class),
59-
Result(column = "occupation", property = "occupation", jdbcType = JdbcType.VARCHAR),
60-
Result(column = "address_id", property = "addressId", jdbcType = JdbcType.INTEGER)])
60+
@Results(
61+
id = "PersonResult", value = [
62+
Result(column = "A_ID", property = "id", jdbcType = JdbcType.INTEGER, id = true),
63+
Result(column = "first_name", property = "firstName", jdbcType = JdbcType.VARCHAR),
64+
Result(
65+
column = "last_name",
66+
property = "lastName",
67+
jdbcType = JdbcType.VARCHAR,
68+
typeHandler = LastNameTypeHandler::class
69+
),
70+
Result(column = "birth_date", property = "birthDate", jdbcType = JdbcType.DATE),
71+
Result(
72+
column = "employed",
73+
property = "employed",
74+
jdbcType = JdbcType.VARCHAR,
75+
typeHandler = YesNoTypeHandler::class
76+
),
77+
Result(column = "occupation", property = "occupation", jdbcType = JdbcType.VARCHAR),
78+
Result(column = "address_id", property = "addressId", jdbcType = JdbcType.INTEGER)]
79+
)
6180
fun selectMany(selectStatement: SelectStatementProvider): List<PersonRecord>
6281

6382
@SelectProvider(type = SqlProviderAdapter::class, method = "select")

src/test/kotlin/examples/kotlin/mybatis3/canonical/PersonWithAddressMapper.kt

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
*/
1616
package examples.kotlin.mybatis3.canonical
1717

18-
import org.apache.ibatis.annotations.*
18+
import org.apache.ibatis.annotations.Mapper
19+
import org.apache.ibatis.annotations.Result
20+
import org.apache.ibatis.annotations.ResultMap
21+
import org.apache.ibatis.annotations.Results
22+
import org.apache.ibatis.annotations.SelectProvider
1923
import org.apache.ibatis.type.JdbcType
2024
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider
2125
import org.mybatis.dynamic.sql.util.SqlProviderAdapter
@@ -29,18 +33,30 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter
2933
interface PersonWithAddressMapper {
3034

3135
@SelectProvider(type = SqlProviderAdapter::class, method = "select")
32-
@Results(id = "PersonWithAddressResult", value = [
33-
Result(column = "A_ID", property = "id", jdbcType = JdbcType.INTEGER, id = true),
34-
Result(column = "first_name", property = "firstName", jdbcType = JdbcType.VARCHAR),
35-
Result(column = "last_name", property = "lastName", jdbcType = JdbcType.VARCHAR, typeHandler = LastNameTypeHandler::class),
36-
Result(column = "birth_date", property = "birthDate", jdbcType = JdbcType.DATE),
37-
Result(column = "employed", property = "employed", jdbcType = JdbcType.VARCHAR, typeHandler = YesNoTypeHandler::class),
38-
Result(column = "occupation", property = "occupation", jdbcType = JdbcType.VARCHAR),
39-
Result(column = "address_id", property = "address.id", jdbcType = JdbcType.INTEGER),
40-
Result(column = "street_address", property = "address.streetAddress", jdbcType = JdbcType.VARCHAR),
41-
Result(column = "city", property = "address.city", jdbcType = JdbcType.VARCHAR),
42-
Result(column = "state", property = "address.state", jdbcType = JdbcType.CHAR)
43-
])
36+
@Results(
37+
id = "PersonWithAddressResult", value = [
38+
Result(column = "A_ID", property = "id", jdbcType = JdbcType.INTEGER, id = true),
39+
Result(column = "first_name", property = "firstName", jdbcType = JdbcType.VARCHAR),
40+
Result(
41+
column = "last_name",
42+
property = "lastName",
43+
jdbcType = JdbcType.VARCHAR,
44+
typeHandler = LastNameTypeHandler::class
45+
),
46+
Result(column = "birth_date", property = "birthDate", jdbcType = JdbcType.DATE),
47+
Result(
48+
column = "employed",
49+
property = "employed",
50+
jdbcType = JdbcType.VARCHAR,
51+
typeHandler = YesNoTypeHandler::class
52+
),
53+
Result(column = "occupation", property = "occupation", jdbcType = JdbcType.VARCHAR),
54+
Result(column = "address_id", property = "address.id", jdbcType = JdbcType.INTEGER),
55+
Result(column = "street_address", property = "address.streetAddress", jdbcType = JdbcType.VARCHAR),
56+
Result(column = "city", property = "address.city", jdbcType = JdbcType.VARCHAR),
57+
Result(column = "state", property = "address.state", jdbcType = JdbcType.CHAR)
58+
]
59+
)
4460
fun selectMany(selectStatement: SelectStatementProvider): List<PersonWithAddress>
4561

4662
@SelectProvider(type = SqlProviderAdapter::class, method = "select")

0 commit comments

Comments
 (0)