Skip to content

Commit

Permalink
deprecate: Raise deprecation levels of API elements (JetBrains#1872)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
bog-walk authored and saral committed Oct 3, 2023
1 parent b57b890 commit d5e90b5
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 168 deletions.
114 changes: 0 additions & 114 deletions exposed-core/api/exposed-core.api

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Op.kt
Original file line number Diff line number Diff line change
Expand Up @@ -526,10 +526,10 @@ class LikeEscapeOp(expr1: Expression<*>, expr2: Expression<*>, like: Boolean, va
}
}

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

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

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ fun <T : Any?> ExpressionWithColumnType<T>.varSamp(scale: Int = 2): VarSamp<T> =

// Sequence Manipulation Functions

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

/** Advances this sequence and returns the new value. */
fun Sequence.nextIntVal(): NextVal<Int> = NextVal.IntNextVal(this)

Expand Down Expand Up @@ -186,9 +182,6 @@ data class LikePattern(
}
}

@Deprecated("Implement interface ISqlExpressionBuilder directly instead", level = DeprecationLevel.HIDDEN)
open class SqlExpressionBuilderClass : ISqlExpressionBuilder

@Suppress("INAPPLICABLE_JVM_NAME", "TooManyFunctions")
interface ISqlExpressionBuilder {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,6 @@ object SchemaUtils {
}
}

@Deprecated(
"Will be removed in upcoming releases. Please use overloaded version instead",
ReplaceWith(
"createFKey(checkNotNull(reference.foreignKey) { \"${"$"}reference does not reference anything\" })"
),
DeprecationLevel.HIDDEN
)
fun createFKey(reference: Column<*>): List<String> {
val foreignKey = reference.foreignKey
require(foreignKey != null && (foreignKey.deleteRule != null || foreignKey.updateRule != null)) {
"$reference does not reference anything"
}
return createFKey(foreignKey)
}

fun createFKey(foreignKey: ForeignKeyConstraint): List<String> = with(foreignKey) {
val allFromColumnsBelongsToTheSameTable = from.all { it.table == fromTable }
require(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@ interface StatementInterceptor {

fun beforeCommit(transaction: Transaction) {}

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

fun beforeRollback(transaction: Transaction) {}

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

fun keepUserDataInTransactionStoreOnCommit(userData: Map<Key<*>, Any?>): Map<Key<*>, Any?> = emptyMap()
Expand Down
2 changes: 0 additions & 2 deletions exposed-dao/api/exposed-dao.api
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,8 @@ public final class org/jetbrains/exposed/dao/EntityHookKt {

public final class org/jetbrains/exposed/dao/EntityLifecycleInterceptor : org/jetbrains/exposed/sql/statements/GlobalStatementInterceptor {
public fun <init> ()V
public synthetic fun afterCommit ()V
public fun afterCommit (Lorg/jetbrains/exposed/sql/Transaction;)V
public fun afterExecution (Lorg/jetbrains/exposed/sql/Transaction;Ljava/util/List;Lorg/jetbrains/exposed/sql/statements/api/PreparedStatementApi;)V
public synthetic fun afterRollback ()V
public fun afterRollback (Lorg/jetbrains/exposed/sql/Transaction;)V
public fun afterStatementPrepared (Lorg/jetbrains/exposed/sql/Transaction;Lorg/jetbrains/exposed/sql/statements/api/PreparedStatementApi;)V
public fun beforeCommit (Lorg/jetbrains/exposed/sql/Transaction;)V
Expand Down
1 change: 0 additions & 1 deletion exposed-java-time/api/exposed-java-time.api
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ public final class org/jetbrains/exposed/sql/javatime/CurrentDate : org/jetbrain

public final class org/jetbrains/exposed/sql/javatime/CurrentDateTime : org/jetbrains/exposed/sql/Function {
public static final field INSTANCE Lorg/jetbrains/exposed/sql/javatime/CurrentDateTime;
public final synthetic fun invoke ()Lorg/jetbrains/exposed/sql/javatime/CurrentDateTime;
public fun toQueryBuilder (Lorg/jetbrains/exposed/sql/QueryBuilder;)V
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ object CurrentDateTime : Function<LocalDateTime>(JavaLocalDateTimeColumnType.INS
else -> "CURRENT_TIMESTAMP"
}
}

@Deprecated(
message = "This class is now a singleton, no need for its constructor call",
replaceWith = ReplaceWith("this"),
level = DeprecationLevel.HIDDEN,
)
operator fun invoke() = this
}

object CurrentDate : Function<LocalDate>(JavaLocalDateColumnType.INSTANCE) {
Expand Down
1 change: 0 additions & 1 deletion exposed-jodatime/api/exposed-jodatime.api
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ public final class org/jetbrains/exposed/sql/jodatime/CurrentDate : org/jetbrain

public final class org/jetbrains/exposed/sql/jodatime/CurrentDateTime : org/jetbrains/exposed/sql/Function {
public static final field INSTANCE Lorg/jetbrains/exposed/sql/jodatime/CurrentDateTime;
public final synthetic fun invoke ()Lorg/jetbrains/exposed/sql/jodatime/CurrentDateTime;
public fun toQueryBuilder (Lorg/jetbrains/exposed/sql/QueryBuilder;)V
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ object CurrentDateTime : Function<DateTime>(DateColumnType(true)) {
else -> "CURRENT_TIMESTAMP"
}
}

@Deprecated(
message = "This class is now a singleton, no need for its constructor call",
replaceWith = ReplaceWith("this"),
level = DeprecationLevel.HIDDEN,
)
operator fun invoke() = this
}

object CurrentDate : Function<DateTime>(DateColumnType(false)) {
Expand Down
1 change: 0 additions & 1 deletion exposed-kotlin-datetime/api/exposed-kotlin-datetime.api
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ public final class org/jetbrains/exposed/sql/kotlin/datetime/CurrentDate : org/j

public final class org/jetbrains/exposed/sql/kotlin/datetime/CurrentDateTime : org/jetbrains/exposed/sql/Function {
public static final field INSTANCE Lorg/jetbrains/exposed/sql/kotlin/datetime/CurrentDateTime;
public final synthetic fun invoke ()Lorg/jetbrains/exposed/sql/kotlin/datetime/CurrentDateTime;
public fun toQueryBuilder (Lorg/jetbrains/exposed/sql/QueryBuilder;)V
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ object CurrentDateTime : Function<LocalDateTime>(KotlinLocalDateTimeColumnType.I
else -> "CURRENT_TIMESTAMP"
}
}

@Deprecated(
message = "This class is now a singleton, no need for its constructor call",
replaceWith = ReplaceWith("this"),
level = DeprecationLevel.HIDDEN,
)
operator fun invoke() = this
}

object CurrentDate : Function<LocalDate>(KotlinLocalDateColumnType.INSTANCE) {
Expand Down

0 comments on commit d5e90b5

Please sign in to comment.