Skip to content

Commit b579d93

Browse files
authored
deprecate: Raise deprecation levels of API elements (#1872)
Raise from ERROR to HIDDEN: - Op.kt classes: LikeOp and NotLikeOp Currently HIDDEN, now removed: - SQLExpressionBuilder.kt Sequence.nextVal() and SqlExpressionBuilderClass - SchemaUtils object createFKey() - StatementInterceptor interface's afterCommit() and afterRollback() - CurrentDateTime object's invoke() (in all 3 date-time modules)
1 parent e9c699a commit b579d93

File tree

12 files changed

+2
-168
lines changed

12 files changed

+2
-168
lines changed

exposed-core/api/exposed-core.api

Lines changed: 0 additions & 114 deletions
Large diffs are not rendered by default.

exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Op.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,10 @@ class LikeEscapeOp(expr1: Expression<*>, expr2: Expression<*>, like: Boolean, va
526526
}
527527
}
528528

529-
@Deprecated("Use LikeEscapeOp", replaceWith = ReplaceWith("LikeEscapeOp(expr1, expr2, true, null)"), DeprecationLevel.ERROR)
529+
@Deprecated("Use LikeEscapeOp", replaceWith = ReplaceWith("LikeEscapeOp(expr1, expr2, true, null)"), DeprecationLevel.HIDDEN)
530530
class LikeOp(expr1: Expression<*>, expr2: Expression<*>) : ComparisonOp(expr1, expr2, "LIKE")
531531

532-
@Deprecated("Use LikeEscapeOp", replaceWith = ReplaceWith("LikeEscapeOp(expr1, expr2, false, null)"), DeprecationLevel.ERROR)
532+
@Deprecated("Use LikeEscapeOp", replaceWith = ReplaceWith("LikeEscapeOp(expr1, expr2, false, null)"), DeprecationLevel.HIDDEN)
533533
class NotLikeOp(expr1: Expression<*>, expr2: Expression<*>) : ComparisonOp(expr1, expr2, "NOT LIKE")
534534

535535
/**

exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SQLExpressionBuilder.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ fun <T : Any?> ExpressionWithColumnType<T>.varSamp(scale: Int = 2): VarSamp<T> =
9898

9999
// Sequence Manipulation Functions
100100

101-
/** Advances this sequence and returns the new value. */
102-
@Deprecated("Please use [nextIntVal] or [nextLongVal] functions", ReplaceWith("nextIntVal()"), DeprecationLevel.HIDDEN)
103-
fun Sequence.nextVal(): NextVal<Int> = nextIntVal()
104-
105101
/** Advances this sequence and returns the new value. */
106102
fun Sequence.nextIntVal(): NextVal<Int> = NextVal.IntNextVal(this)
107103

@@ -186,9 +182,6 @@ data class LikePattern(
186182
}
187183
}
188184

189-
@Deprecated("Implement interface ISqlExpressionBuilder directly instead", level = DeprecationLevel.HIDDEN)
190-
open class SqlExpressionBuilderClass : ISqlExpressionBuilder
191-
192185
@Suppress("INAPPLICABLE_JVM_NAME", "TooManyFunctions")
193186
interface ISqlExpressionBuilder {
194187

exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SchemaUtils.kt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,6 @@ object SchemaUtils {
117117
}
118118
}
119119

120-
@Deprecated(
121-
"Will be removed in upcoming releases. Please use overloaded version instead",
122-
ReplaceWith(
123-
"createFKey(checkNotNull(reference.foreignKey) { \"${"$"}reference does not reference anything\" })"
124-
),
125-
DeprecationLevel.HIDDEN
126-
)
127-
fun createFKey(reference: Column<*>): List<String> {
128-
val foreignKey = reference.foreignKey
129-
require(foreignKey != null && (foreignKey.deleteRule != null || foreignKey.updateRule != null)) {
130-
"$reference does not reference anything"
131-
}
132-
return createFKey(foreignKey)
133-
}
134-
135120
fun createFKey(foreignKey: ForeignKeyConstraint): List<String> = with(foreignKey) {
136121
val allFromColumnsBelongsToTheSameTable = from.all { it.table == fromTable }
137122
require(

exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/StatementInterceptor.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ interface StatementInterceptor {
2020

2121
fun beforeCommit(transaction: Transaction) {}
2222

23-
@Deprecated("Use afterCommit() with a transaction", level = DeprecationLevel.HIDDEN)
24-
fun afterCommit() {}
2523
fun afterCommit(transaction: Transaction) {}
2624

2725
fun beforeRollback(transaction: Transaction) {}
2826

29-
@Deprecated("Use afterRollback() with a transaction", level = DeprecationLevel.HIDDEN)
30-
fun afterRollback() {}
3127
fun afterRollback(transaction: Transaction) {}
3228

3329
fun keepUserDataInTransactionStoreOnCommit(userData: Map<Key<*>, Any?>): Map<Key<*>, Any?> = emptyMap()

exposed-dao/api/exposed-dao.api

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,8 @@ public final class org/jetbrains/exposed/dao/EntityHookKt {
185185

186186
public final class org/jetbrains/exposed/dao/EntityLifecycleInterceptor : org/jetbrains/exposed/sql/statements/GlobalStatementInterceptor {
187187
public fun <init> ()V
188-
public synthetic fun afterCommit ()V
189188
public fun afterCommit (Lorg/jetbrains/exposed/sql/Transaction;)V
190189
public fun afterExecution (Lorg/jetbrains/exposed/sql/Transaction;Ljava/util/List;Lorg/jetbrains/exposed/sql/statements/api/PreparedStatementApi;)V
191-
public synthetic fun afterRollback ()V
192190
public fun afterRollback (Lorg/jetbrains/exposed/sql/Transaction;)V
193191
public fun afterStatementPrepared (Lorg/jetbrains/exposed/sql/Transaction;Lorg/jetbrains/exposed/sql/statements/api/PreparedStatementApi;)V
194192
public fun beforeCommit (Lorg/jetbrains/exposed/sql/Transaction;)V

exposed-java-time/api/exposed-java-time.api

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ public final class org/jetbrains/exposed/sql/javatime/CurrentDate : org/jetbrain
55

66
public final class org/jetbrains/exposed/sql/javatime/CurrentDateTime : org/jetbrains/exposed/sql/Function {
77
public static final field INSTANCE Lorg/jetbrains/exposed/sql/javatime/CurrentDateTime;
8-
public final synthetic fun invoke ()Lorg/jetbrains/exposed/sql/javatime/CurrentDateTime;
98
public fun toQueryBuilder (Lorg/jetbrains/exposed/sql/QueryBuilder;)V
109
}
1110

exposed-java-time/src/main/kotlin/org/jetbrains/exposed/sql/javatime/JavaDateFunctions.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ object CurrentDateTime : Function<LocalDateTime>(JavaLocalDateTimeColumnType.INS
3030
else -> "CURRENT_TIMESTAMP"
3131
}
3232
}
33-
34-
@Deprecated(
35-
message = "This class is now a singleton, no need for its constructor call",
36-
replaceWith = ReplaceWith("this"),
37-
level = DeprecationLevel.HIDDEN,
38-
)
39-
operator fun invoke() = this
4033
}
4134

4235
object CurrentDate : Function<LocalDate>(JavaLocalDateColumnType.INSTANCE) {

exposed-jodatime/api/exposed-jodatime.api

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ public final class org/jetbrains/exposed/sql/jodatime/CurrentDate : org/jetbrain
55

66
public final class org/jetbrains/exposed/sql/jodatime/CurrentDateTime : org/jetbrains/exposed/sql/Function {
77
public static final field INSTANCE Lorg/jetbrains/exposed/sql/jodatime/CurrentDateTime;
8-
public final synthetic fun invoke ()Lorg/jetbrains/exposed/sql/jodatime/CurrentDateTime;
98
public fun toQueryBuilder (Lorg/jetbrains/exposed/sql/QueryBuilder;)V
109
}
1110

exposed-jodatime/src/main/kotlin/org/jetbrains/exposed/sql/jodatime/DateFunctions.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ object CurrentDateTime : Function<DateTime>(DateColumnType(true)) {
2020
else -> "CURRENT_TIMESTAMP"
2121
}
2222
}
23-
24-
@Deprecated(
25-
message = "This class is now a singleton, no need for its constructor call",
26-
replaceWith = ReplaceWith("this"),
27-
level = DeprecationLevel.HIDDEN,
28-
)
29-
operator fun invoke() = this
3023
}
3124

3225
object CurrentDate : Function<DateTime>(DateColumnType(false)) {

0 commit comments

Comments
 (0)