@@ -80,14 +80,6 @@ fun <T : Any> NamedParameterJdbcTemplate.insertBatch(
80
80
): IntArray =
81
81
insertBatch(org.mybatis.dynamic .sql.util.kotlin.spring.insertBatch(records, completer))
82
82
83
- @Deprecated(" Please move the into phrase inside the lambda" )
84
- fun <T : Any > NamedParameterJdbcTemplate.insertBatch (vararg records : T ): BatchInsertHelper <T > =
85
- insertBatch(records.asList())
86
-
87
- @Deprecated(" Please move the into phrase inside the lambda" )
88
- fun <T : Any > NamedParameterJdbcTemplate.insertBatch (records : List <T >): BatchInsertHelper <T > =
89
- BatchInsertHelper (records, this )
90
-
91
83
// single row insert
92
84
fun <T > NamedParameterJdbcTemplate.insert (insertStatement : InsertStatementProvider <T >): Int =
93
85
update(insertStatement.insertStatement, BeanPropertySqlParameterSource (insertStatement.row))
@@ -101,10 +93,6 @@ fun <T> NamedParameterJdbcTemplate.insert(
101
93
fun <T : Any > NamedParameterJdbcTemplate.insert (row : T , completer : KotlinInsertCompleter <T >): Int =
102
94
insert(org.mybatis.dynamic .sql.util.kotlin.spring.insert(row, completer))
103
95
104
- @Deprecated(" Please move the into phrase inside the lambda" )
105
- fun <T : Any > NamedParameterJdbcTemplate.insert (row : T ): SingleRowInsertHelper <T > =
106
- SingleRowInsertHelper (row, this )
107
-
108
96
// general insert
109
97
fun NamedParameterJdbcTemplate.generalInsert (insertStatement : GeneralInsertStatementProvider ): Int =
110
98
update(insertStatement.insertStatement, insertStatement.parameters)
@@ -131,14 +119,6 @@ fun <T : Any> NamedParameterJdbcTemplate.insertMultiple(
131
119
): Int =
132
120
insertMultiple(org.mybatis.dynamic .sql.util.kotlin.spring.insertMultiple(records, completer))
133
121
134
- @Deprecated(" Please move the into phrase inside the lambda" )
135
- fun <T : Any > NamedParameterJdbcTemplate.insertMultiple (vararg records : T ): MultiRowInsertHelper <T > =
136
- insertMultiple(records.asList())
137
-
138
- @Deprecated(" Please move the into phrase inside the lambda" )
139
- fun <T : Any > NamedParameterJdbcTemplate.insertMultiple (records : List <T >): MultiRowInsertHelper <T > =
140
- MultiRowInsertHelper (records, this )
141
-
142
122
fun <T > NamedParameterJdbcTemplate.insertMultiple (insertStatement : MultiRowInsertStatementProvider <T >): Int =
143
123
update(insertStatement.insertStatement, BeanPropertySqlParameterSource (insertStatement))
144
124
@@ -148,10 +128,6 @@ fun <T> NamedParameterJdbcTemplate.insertMultiple(
148
128
): Int =
149
129
update(insertStatement.insertStatement, BeanPropertySqlParameterSource (insertStatement), keyHolder)
150
130
151
- @Deprecated(" Please use the new form - move the table into the lambda with into(table)" )
152
- fun NamedParameterJdbcTemplate.insertSelect (table : SqlTable , completer : InsertSelectCompleter ): Int =
153
- insertSelect(org.mybatis.dynamic .sql.util.kotlin.spring.insertSelect(table, completer))
154
-
155
131
fun NamedParameterJdbcTemplate.insertSelect (completer : InsertSelectCompleter ): Int =
156
132
insertSelect(org.mybatis.dynamic .sql.util.kotlin.spring.insertSelect(completer))
157
133
@@ -291,102 +267,13 @@ class KeyHolderHelper(private val keyHolder: KeyHolder, private val template: Na
291
267
fun <T : Any > insert (row : T , completer : KotlinInsertCompleter <T >): Int =
292
268
template.insert(org.mybatis.dynamic .sql.util.kotlin.spring.insert(row, completer), keyHolder)
293
269
294
- @Deprecated(" Please move the into phrase inside the lambda" )
295
- fun <T : Any > insert (row : T ): SingleRowInsertWithKeyHolderHelper <T > =
296
- SingleRowInsertWithKeyHolderHelper (row, template, keyHolder)
297
-
298
270
fun <T : Any > insertMultiple (vararg records : T , completer : KotlinMultiRowInsertCompleter <T >): Int =
299
271
insertMultiple(records.asList(), completer)
300
272
301
273
fun <T : Any > insertMultiple (records : List <T >, completer : KotlinMultiRowInsertCompleter <T >): Int =
302
274
template.insertMultiple(org.mybatis.dynamic .sql.util.kotlin.spring.insertMultiple(records, completer),
303
275
keyHolder)
304
276
305
- @Deprecated(" Please move the into phrase inside the lambda" )
306
- fun <T : Any > insertMultiple (vararg records : T ): MultiRowInsertWithKeyHolderHelper <T > =
307
- insertMultiple(records.asList())
308
-
309
- @Deprecated(" Please move the into phrase inside the lambda" )
310
- fun <T : Any > insertMultiple (records : List <T >): MultiRowInsertWithKeyHolderHelper <T > =
311
- MultiRowInsertWithKeyHolderHelper (records, template, keyHolder)
312
-
313
- fun insertSelect (table : SqlTable , completer : InsertSelectCompleter ): Int =
314
- template.insertSelect(org.mybatis.dynamic .sql.util.kotlin.spring.insertSelect(table, completer), keyHolder)
315
- }
316
-
317
- @MyBatisDslMarker
318
- class BatchInsertHelper <T : Any >(private val records : List <T >, private val template : NamedParameterJdbcTemplate ) {
319
- fun into (table : SqlTable , completer : KotlinBatchInsertCompleter <T >): IntArray =
320
- template.insertBatch(
321
- insertBatch(records) {
322
- into(table)
323
- run (completer)
324
- }
325
- )
326
- }
327
-
328
- @MyBatisDslMarker
329
- class MultiRowInsertHelper <T : Any >(
330
- private val records : List <T >,
331
- private val template : NamedParameterJdbcTemplate
332
- ) {
333
- fun into (table : SqlTable , completer : KotlinMultiRowInsertCompleter <T >): Int =
334
- with (
335
- insertMultiple(records) {
336
- into(table)
337
- run (completer)
338
- }
339
- ) {
340
- template.insertMultiple(this )
341
- }
342
- }
343
-
344
- @MyBatisDslMarker
345
- class MultiRowInsertWithKeyHolderHelper <T : Any >(
346
- private val records : List <T >,
347
- private val template : NamedParameterJdbcTemplate ,
348
- private val keyHolder : KeyHolder
349
- ) {
350
- fun into (table : SqlTable , completer : KotlinMultiRowInsertCompleter <T >): Int =
351
- with (
352
- insertMultiple(records) {
353
- into(table)
354
- run (completer)
355
- }
356
- ) {
357
- template.insertMultiple(this , keyHolder)
358
- }
359
- }
360
-
361
- @MyBatisDslMarker
362
- class SingleRowInsertHelper <T : Any >(
363
- private val row : T ,
364
- private val template : NamedParameterJdbcTemplate
365
- ) {
366
- fun into (table : SqlTable , completer : KotlinInsertCompleter <T >): Int =
367
- with (
368
- insert(row) {
369
- into(table)
370
- run (completer)
371
- }
372
- ) {
373
- template.insert(this )
374
- }
375
- }
376
-
377
- @MyBatisDslMarker
378
- class SingleRowInsertWithKeyHolderHelper <T : Any >(
379
- private val row : T ,
380
- private val template : NamedParameterJdbcTemplate ,
381
- private val keyHolder : KeyHolder
382
- ) {
383
- fun into (table : SqlTable , completer : KotlinInsertCompleter <T >): Int =
384
- with (
385
- insert(row) {
386
- into(table)
387
- run (completer)
388
- }
389
- ) {
390
- template.insert(this , keyHolder)
391
- }
277
+ fun insertSelect (completer : InsertSelectCompleter ): Int =
278
+ template.insertSelect(org.mybatis.dynamic .sql.util.kotlin.spring.insertSelect(completer), keyHolder)
392
279
}
0 commit comments