15
15
*/
16
16
package org.mybatis.dynamic.sql.util.kotlin
17
17
18
- import org.mybatis.dynamic.sql.BindableColumn
19
18
import org.mybatis.dynamic.sql.AndOrCriteriaGroup
20
- import org.mybatis.dynamic.sql.ExistsPredicate
21
19
import org.mybatis.dynamic.sql.SqlTable
22
- import org.mybatis.dynamic.sql.VisitableCondition
23
20
import org.mybatis.dynamic.sql.configuration.StatementConfiguration
24
21
import org.mybatis.dynamic.sql.select.AbstractQueryExpressionDSL
25
- import org.mybatis.dynamic.sql.where.AbstractWhereDSL
26
22
import org.mybatis.dynamic.sql.where.AbstractWhereSupport
27
23
28
24
@Target(AnnotationTarget .CLASS , AnnotationTarget .TYPE )
@@ -73,96 +69,6 @@ abstract class KotlinBaseBuilder<D : AbstractWhereSupport<*,*>> {
73
69
74
70
fun applyWhere (whereApplier : WhereApplier ) = whereApplier.invoke(this )
75
71
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
-
166
72
/* *
167
73
* This function does nothing, but it can be used to make some code snippets more understandable.
168
74
*
@@ -179,17 +85,6 @@ abstract class KotlinBaseBuilder<D : AbstractWhereSupport<*,*>> {
179
85
// intentionally empty - this function exists for code beautification and clarity only
180
86
}
181
87
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
-
193
88
protected abstract fun getDsl (): D
194
89
}
195
90
0 commit comments