Skip to content

Commit b2fb0a1

Browse files
committed
Deprecate existing where DSL
1 parent 2bbff97 commit b2fb0a1

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ import org.mybatis.dynamic.sql.ExistsPredicate
2323
import org.mybatis.dynamic.sql.SqlCriterion
2424
import org.mybatis.dynamic.sql.VisitableCondition
2525

26+
@Deprecated("Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.")
2627
typealias CriteriaReceiver = CriteriaCollector.() -> Unit
2728

29+
@Deprecated("Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.")
2830
@MyBatisDslMarker
2931
class CriteriaCollector {
3032
val criteria = mutableListOf<AndOrCriteriaGroup>()

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,61 +58,82 @@ abstract class KotlinBaseBuilder<D : AbstractWhereSupport<*>, B : KotlinBaseBuil
5858
whereApplier.invoke(this)
5959
}
6060

61+
@Deprecated("Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.")
6162
fun <T> where(column: BindableColumn<T>, condition: VisitableCondition<T>): B =
6263
applyToWhere {
6364
where(column, condition)
6465
}
6566

67+
@Deprecated("Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.")
6668
fun <T> where(column: BindableColumn<T>, condition: VisitableCondition<T>, subCriteria: CriteriaReceiver): B =
6769
applyToWhere(subCriteria) { sc ->
6870
where(column, condition, sc)
6971
}
7072

73+
@Deprecated(
74+
message = "Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.",
75+
replaceWith = ReplaceWith("where { existsPredicate }")
76+
)
7177
fun where(existsPredicate: ExistsPredicate): B =
7278
applyToWhere {
7379
where(existsPredicate)
7480
}
7581

82+
@Deprecated("Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.")
7683
fun where(existsPredicate: ExistsPredicate, subCriteria: CriteriaReceiver): B =
7784
applyToWhere(subCriteria) { sc ->
7885
where(existsPredicate, sc)
7986
}
8087

88+
@Deprecated("Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.")
8189
fun <T> and(column: BindableColumn<T>, condition: VisitableCondition<T>): B =
8290
applyToWhere {
8391
and(column, condition)
8492
}
8593

94+
@Deprecated("Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.")
8695
fun <T> and(column: BindableColumn<T>, condition: VisitableCondition<T>, subCriteria: CriteriaReceiver): B =
8796
applyToWhere(subCriteria) { sc ->
8897
and(column, condition, sc)
8998
}
9099

100+
@Deprecated(
101+
message = "Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.",
102+
replaceWith = ReplaceWith("and { existsPredicate }")
103+
)
91104
fun and(existsPredicate: ExistsPredicate): B =
92105
applyToWhere {
93106
and(existsPredicate)
94107
}
95108

109+
@Deprecated("Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.")
96110
fun and(existsPredicate: ExistsPredicate, subCriteria: CriteriaReceiver): B =
97111
applyToWhere(subCriteria) { sc ->
98112
and(existsPredicate, sc)
99113
}
100114

115+
@Deprecated("Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.")
101116
fun <T> or(column: BindableColumn<T>, condition: VisitableCondition<T>): B =
102117
applyToWhere {
103118
or(column, condition)
104119
}
105120

121+
@Deprecated("Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.")
106122
fun <T> or(column: BindableColumn<T>, condition: VisitableCondition<T>, subCriteria: CriteriaReceiver): B =
107123
applyToWhere(subCriteria) { sc ->
108124
or(column, condition, sc)
109125
}
110126

127+
@Deprecated(
128+
message = "Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.",
129+
replaceWith = ReplaceWith("or { existsPredicate }")
130+
)
111131
fun or(existsPredicate: ExistsPredicate): B =
112132
applyToWhere {
113133
or(existsPredicate)
114134
}
115135

136+
@Deprecated("Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.")
116137
fun or(existsPredicate: ExistsPredicate, subCriteria: CriteriaReceiver): B =
117138
applyToWhere(subCriteria) { sc ->
118139
or(existsPredicate, sc)

src/main/kotlin/org/mybatis/dynamic/sql/util/kotlin/elements/SqlElements.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,11 @@ fun <T> isNull(): IsNull<T> = SqlBuilder.isNull()
151151

152152
fun <T> isNotNull(): IsNotNull<T> = SqlBuilder.isNotNull()
153153

154+
@Deprecated("Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.")
154155
fun exists(subQuery: KotlinSubQueryBuilder.() -> Unit): ExistsPredicate =
155156
SqlBuilder.exists(KotlinSubQueryBuilder().apply(subQuery))
156157

158+
@Deprecated("Deprecated in favor of the new where clause DSL. Please see the documentation for new usage.")
157159
fun notExists(subQuery: KotlinSubQueryBuilder.() -> Unit): ExistsPredicate =
158160
SqlBuilder.notExists(KotlinSubQueryBuilder().apply(subQuery))
159161

0 commit comments

Comments
 (0)