Skip to content

Commit ca967c9

Browse files
committed
Remove Deprecated Kotlin Where DSL
1 parent 37c3f83 commit ca967c9

File tree

3 files changed

+0
-847
lines changed

3 files changed

+0
-847
lines changed

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

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

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

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,10 @@
1515
*/
1616
package org.mybatis.dynamic.sql.util.kotlin
1717

18-
import org.mybatis.dynamic.sql.BindableColumn
1918
import org.mybatis.dynamic.sql.AndOrCriteriaGroup
20-
import org.mybatis.dynamic.sql.ExistsPredicate
2119
import org.mybatis.dynamic.sql.SqlTable
22-
import org.mybatis.dynamic.sql.VisitableCondition
2320
import org.mybatis.dynamic.sql.configuration.StatementConfiguration
2421
import org.mybatis.dynamic.sql.select.AbstractQueryExpressionDSL
25-
import org.mybatis.dynamic.sql.where.AbstractWhereDSL
2622
import org.mybatis.dynamic.sql.where.AbstractWhereSupport
2723

2824
@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE)
@@ -73,96 +69,6 @@ abstract class KotlinBaseBuilder<D : AbstractWhereSupport<*,*>> {
7369

7470
fun applyWhere(whereApplier: WhereApplier) = whereApplier.invoke(this)
7571

76-
@Deprecated("Deprecated in favor of the new where clause DSL. Update by moving the column and condition " +
77-
"into a lambda and rewriting the condition to use an infix function.")
78-
fun <T> where(column: BindableColumn<T>, condition: VisitableCondition<T>): Unit =
79-
applyToWhere {
80-
where(column, condition)
81-
}
82-
83-
@Deprecated("Deprecated in favor of the new where clause DSL. Update by moving the column and condition " +
84-
"inside the lambda and rewriting the condition to use an infix function.")
85-
fun <T> where(column: BindableColumn<T>, condition: VisitableCondition<T>, subCriteria: CriteriaReceiver): Unit =
86-
applyToWhere(subCriteria) { sc ->
87-
where(column, condition, sc)
88-
}
89-
90-
@Deprecated(
91-
message = "Deprecated in favor of the new where clause DSL.",
92-
replaceWith = ReplaceWith("where { existsPredicate }")
93-
)
94-
fun where(existsPredicate: ExistsPredicate): Unit =
95-
applyToWhere {
96-
where(existsPredicate)
97-
}
98-
99-
@Deprecated("Deprecated in favor of the new where clause DSL. Update by moving the exists expression " +
100-
"into the lambda.")
101-
fun where(existsPredicate: ExistsPredicate, subCriteria: CriteriaReceiver): Unit =
102-
applyToWhere(subCriteria) { sc ->
103-
where(existsPredicate, sc)
104-
}
105-
106-
@Deprecated("Deprecated in favor of the new where clause DSL. Update by moving the column and condition " +
107-
"into a lambda and rewriting the condition to use an infix function.")
108-
fun <T> and(column: BindableColumn<T>, condition: VisitableCondition<T>): Unit =
109-
applyToWhere {
110-
and(column, condition)
111-
}
112-
113-
@Deprecated("Deprecated in favor of the new where clause DSL. Update by moving the column and condition " +
114-
"inside the lambda and rewriting the condition to use an infix function.")
115-
fun <T> and(column: BindableColumn<T>, condition: VisitableCondition<T>, subCriteria: CriteriaReceiver): Unit =
116-
applyToWhere(subCriteria) { sc ->
117-
and(column, condition, sc)
118-
}
119-
120-
@Deprecated(
121-
message = "Deprecated in favor of the new where clause DSL.",
122-
replaceWith = ReplaceWith("and { existsPredicate }")
123-
)
124-
fun and(existsPredicate: ExistsPredicate): Unit =
125-
applyToWhere {
126-
and(existsPredicate)
127-
}
128-
129-
@Deprecated("Deprecated in favor of the new where clause DSL. Update by moving the exists expression " +
130-
"into the lambda.")
131-
fun and(existsPredicate: ExistsPredicate, subCriteria: CriteriaReceiver): Unit =
132-
applyToWhere(subCriteria) { sc ->
133-
and(existsPredicate, sc)
134-
}
135-
136-
@Deprecated("Deprecated in favor of the new where clause DSL. Update by moving the column and condition " +
137-
"into a lambda and rewriting the condition to use an infix function.")
138-
fun <T> or(column: BindableColumn<T>, condition: VisitableCondition<T>): Unit =
139-
applyToWhere {
140-
or(column, condition)
141-
}
142-
143-
@Deprecated("Deprecated in favor of the new where clause DSL. Update by moving the column and condition " +
144-
"inside the lambda and rewriting the condition to use an infix function.")
145-
fun <T> or(column: BindableColumn<T>, condition: VisitableCondition<T>, subCriteria: CriteriaReceiver): Unit =
146-
applyToWhere(subCriteria) { sc ->
147-
or(column, condition, sc)
148-
}
149-
150-
@Deprecated(
151-
message = "Deprecated in favor of the new where clause DSL.",
152-
replaceWith = ReplaceWith("or { existsPredicate }")
153-
)
154-
fun or(existsPredicate: ExistsPredicate): Unit =
155-
applyToWhere {
156-
or(existsPredicate)
157-
}
158-
159-
@Deprecated("Deprecated in favor of the new where clause DSL. Update by moving the exists expression " +
160-
"into the lambda.")
161-
fun or(existsPredicate: ExistsPredicate, subCriteria: CriteriaReceiver): Unit =
162-
applyToWhere(subCriteria) { sc ->
163-
or(existsPredicate, sc)
164-
}
165-
16672
/**
16773
* This function does nothing, but it can be used to make some code snippets more understandable.
16874
*
@@ -179,17 +85,6 @@ abstract class KotlinBaseBuilder<D : AbstractWhereSupport<*,*>> {
17985
// intentionally empty - this function exists for code beautification and clarity only
18086
}
18187

182-
private fun applyToWhere(block: AbstractWhereDSL<*>.() -> Unit) {
183-
getDsl().where().apply(block)
184-
}
185-
186-
private fun applyToWhere(
187-
subCriteria: CriteriaReceiver,
188-
block: AbstractWhereDSL<*>.(List<AndOrCriteriaGroup>) -> Unit
189-
) {
190-
getDsl().where().block(CriteriaCollector().apply(subCriteria).criteria)
191-
}
192-
19388
protected abstract fun getDsl(): D
19489
}
19590

0 commit comments

Comments
 (0)