From 225f2639062fcfb72da0bebca23bad8218e91f04 Mon Sep 17 00:00:00 2001 From: Chantal Loncle <82039410+bog-walk@users.noreply.github.com> Date: Sun, 25 Jun 2023 22:24:54 -0400 Subject: [PATCH 1/4] deprecate: EXPOSED-84 Raise deprecation levels of API elements Raise levels of API elements annotated with @Deprecated as per gradual phase-out guidelines. Raise from WARNING to ERROR: - Op.kt classes: LikeOp, NotLikeOp Raise from ERROR to HIDDEN: - CurrentDateTime object's invoke() (in all 3 datetime modules) - StatementInterceptor afterCommit() and afterRollback() - SchemaUtils createFKey() - SQLExpressionBuilder Sequence.nextVal() - SqlExpressionBuilderClass Currently HIDDEN API, now removed: - Database companion object's connect() - ColumnType property autoIncSeqName --- exposed-core/api/exposed-core.api | 17 +++++++--------- .../org/jetbrains/exposed/sql/ColumnType.kt | 8 -------- .../org/jetbrains/exposed/sql/Database.kt | 20 ------------------- .../kotlin/org/jetbrains/exposed/sql/Op.kt | 4 ++-- .../exposed/sql/SQLExpressionBuilder.kt | 4 ++-- .../org/jetbrains/exposed/sql/SchemaUtils.kt | 2 +- .../sql/statements/StatementInterceptor.kt | 6 ++---- exposed-java-time/api/exposed-java-time.api | 2 +- .../exposed/sql/javatime/JavaDateFunctions.kt | 5 ++--- exposed-jodatime/api/exposed-jodatime.api | 2 +- .../exposed/sql/jodatime/DateFunctions.kt | 5 ++--- .../api/exposed-kotlin-datetime.api | 2 +- .../kotlin/datetime/KotlinDateFunctions.kt | 6 ++---- 13 files changed, 23 insertions(+), 60 deletions(-) diff --git a/exposed-core/api/exposed-core.api b/exposed-core/api/exposed-core.api index 448bde2bb3..b19685804f 100644 --- a/exposed-core/api/exposed-core.api +++ b/exposed-core/api/exposed-core.api @@ -423,7 +423,6 @@ public abstract class org/jetbrains/exposed/sql/ColumnType : org/jetbrains/expos public final class org/jetbrains/exposed/sql/ColumnTypeKt { public static final fun getAutoIncColumnType (Lorg/jetbrains/exposed/sql/Column;)Lorg/jetbrains/exposed/sql/AutoIncColumnType; - public static final synthetic fun getAutoIncSeqName (Lorg/jetbrains/exposed/sql/Column;)Ljava/lang/String; public static final fun isAutoInc (Lorg/jetbrains/exposed/sql/IColumnType;)Z } @@ -519,11 +518,9 @@ public final class org/jetbrains/exposed/sql/Database { public final class org/jetbrains/exposed/sql/Database$Companion { public final fun connect (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lorg/jetbrains/exposed/sql/DatabaseConfig;Lkotlin/jvm/functions/Function1;)Lorg/jetbrains/exposed/sql/Database; - public final synthetic fun connect (Ljavax/sql/ConnectionPoolDataSource;Lkotlin/jvm/functions/Function1;Lorg/jetbrains/exposed/sql/DatabaseConfig;Lkotlin/jvm/functions/Function1;)Lorg/jetbrains/exposed/sql/Database; public final fun connect (Ljavax/sql/DataSource;Lkotlin/jvm/functions/Function1;Lorg/jetbrains/exposed/sql/DatabaseConfig;Lkotlin/jvm/functions/Function1;)Lorg/jetbrains/exposed/sql/Database; public final fun connect (Lkotlin/jvm/functions/Function0;Lorg/jetbrains/exposed/sql/DatabaseConfig;Lkotlin/jvm/functions/Function1;)Lorg/jetbrains/exposed/sql/Database; public static synthetic fun connect$default (Lorg/jetbrains/exposed/sql/Database$Companion;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lorg/jetbrains/exposed/sql/DatabaseConfig;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/jetbrains/exposed/sql/Database; - public static synthetic fun connect$default (Lorg/jetbrains/exposed/sql/Database$Companion;Ljavax/sql/ConnectionPoolDataSource;Lkotlin/jvm/functions/Function1;Lorg/jetbrains/exposed/sql/DatabaseConfig;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/jetbrains/exposed/sql/Database; public static synthetic fun connect$default (Lorg/jetbrains/exposed/sql/Database$Companion;Ljavax/sql/DataSource;Lkotlin/jvm/functions/Function1;Lorg/jetbrains/exposed/sql/DatabaseConfig;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/jetbrains/exposed/sql/Database; public static synthetic fun connect$default (Lorg/jetbrains/exposed/sql/Database$Companion;Lkotlin/jvm/functions/Function0;Lorg/jetbrains/exposed/sql/DatabaseConfig;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/jetbrains/exposed/sql/Database; public final fun connectPool (Ljavax/sql/ConnectionPoolDataSource;Lkotlin/jvm/functions/Function1;Lorg/jetbrains/exposed/sql/DatabaseConfig;Lkotlin/jvm/functions/Function1;)Lorg/jetbrains/exposed/sql/Database; @@ -1680,7 +1677,7 @@ public final class org/jetbrains/exposed/sql/SchemaUtils { public static synthetic fun create$default (Lorg/jetbrains/exposed/sql/SchemaUtils;[Lorg/jetbrains/exposed/sql/Table;ZILjava/lang/Object;)V public final fun createDatabase ([Ljava/lang/String;Z)V public static synthetic fun createDatabase$default (Lorg/jetbrains/exposed/sql/SchemaUtils;[Ljava/lang/String;ZILjava/lang/Object;)V - public final fun createFKey (Lorg/jetbrains/exposed/sql/Column;)Ljava/util/List; + public final synthetic fun createFKey (Lorg/jetbrains/exposed/sql/Column;)Ljava/util/List; public final fun createFKey (Lorg/jetbrains/exposed/sql/ForeignKeyConstraint;)Ljava/util/List; public final fun createIndex (Lorg/jetbrains/exposed/sql/Index;)Ljava/util/List; public final fun createMissingTablesAndColumns ([Lorg/jetbrains/exposed/sql/Table;ZZ)V @@ -2557,10 +2554,10 @@ public abstract interface class org/jetbrains/exposed/sql/statements/GlobalState } public final class org/jetbrains/exposed/sql/statements/GlobalStatementInterceptor$DefaultImpls { - public static fun afterCommit (Lorg/jetbrains/exposed/sql/statements/GlobalStatementInterceptor;)V + public static synthetic fun afterCommit (Lorg/jetbrains/exposed/sql/statements/GlobalStatementInterceptor;)V public static fun afterCommit (Lorg/jetbrains/exposed/sql/statements/GlobalStatementInterceptor;Lorg/jetbrains/exposed/sql/Transaction;)V public static fun afterExecution (Lorg/jetbrains/exposed/sql/statements/GlobalStatementInterceptor;Lorg/jetbrains/exposed/sql/Transaction;Ljava/util/List;Lorg/jetbrains/exposed/sql/statements/api/PreparedStatementApi;)V - public static fun afterRollback (Lorg/jetbrains/exposed/sql/statements/GlobalStatementInterceptor;)V + public static synthetic fun afterRollback (Lorg/jetbrains/exposed/sql/statements/GlobalStatementInterceptor;)V public static fun afterRollback (Lorg/jetbrains/exposed/sql/statements/GlobalStatementInterceptor;Lorg/jetbrains/exposed/sql/Transaction;)V public static fun afterStatementPrepared (Lorg/jetbrains/exposed/sql/statements/GlobalStatementInterceptor;Lorg/jetbrains/exposed/sql/Transaction;Lorg/jetbrains/exposed/sql/statements/api/PreparedStatementApi;)V public static fun beforeCommit (Lorg/jetbrains/exposed/sql/statements/GlobalStatementInterceptor;Lorg/jetbrains/exposed/sql/Transaction;)V @@ -2650,10 +2647,10 @@ public final class org/jetbrains/exposed/sql/statements/StatementGroup : java/la } public abstract interface class org/jetbrains/exposed/sql/statements/StatementInterceptor { - public abstract fun afterCommit ()V + public abstract synthetic fun afterCommit ()V public abstract fun afterCommit (Lorg/jetbrains/exposed/sql/Transaction;)V public abstract fun afterExecution (Lorg/jetbrains/exposed/sql/Transaction;Ljava/util/List;Lorg/jetbrains/exposed/sql/statements/api/PreparedStatementApi;)V - public abstract fun afterRollback ()V + public abstract synthetic fun afterRollback ()V public abstract fun afterRollback (Lorg/jetbrains/exposed/sql/Transaction;)V public abstract fun afterStatementPrepared (Lorg/jetbrains/exposed/sql/Transaction;Lorg/jetbrains/exposed/sql/statements/api/PreparedStatementApi;)V public abstract fun beforeCommit (Lorg/jetbrains/exposed/sql/Transaction;)V @@ -2663,10 +2660,10 @@ public abstract interface class org/jetbrains/exposed/sql/statements/StatementIn } public final class org/jetbrains/exposed/sql/statements/StatementInterceptor$DefaultImpls { - public static fun afterCommit (Lorg/jetbrains/exposed/sql/statements/StatementInterceptor;)V + public static synthetic fun afterCommit (Lorg/jetbrains/exposed/sql/statements/StatementInterceptor;)V public static fun afterCommit (Lorg/jetbrains/exposed/sql/statements/StatementInterceptor;Lorg/jetbrains/exposed/sql/Transaction;)V public static fun afterExecution (Lorg/jetbrains/exposed/sql/statements/StatementInterceptor;Lorg/jetbrains/exposed/sql/Transaction;Ljava/util/List;Lorg/jetbrains/exposed/sql/statements/api/PreparedStatementApi;)V - public static fun afterRollback (Lorg/jetbrains/exposed/sql/statements/StatementInterceptor;)V + public static synthetic fun afterRollback (Lorg/jetbrains/exposed/sql/statements/StatementInterceptor;)V public static fun afterRollback (Lorg/jetbrains/exposed/sql/statements/StatementInterceptor;Lorg/jetbrains/exposed/sql/Transaction;)V public static fun afterStatementPrepared (Lorg/jetbrains/exposed/sql/statements/StatementInterceptor;Lorg/jetbrains/exposed/sql/Transaction;Lorg/jetbrains/exposed/sql/statements/api/PreparedStatementApi;)V public static fun beforeCommit (Lorg/jetbrains/exposed/sql/statements/StatementInterceptor;Lorg/jetbrains/exposed/sql/Transaction;)V diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/ColumnType.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/ColumnType.kt index 7720ab4831..ed26382744 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/ColumnType.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/ColumnType.kt @@ -162,14 +162,6 @@ val IColumnType.isAutoInc: Boolean get() = this is AutoIncColumnType || (this is val Column<*>.autoIncColumnType: AutoIncColumnType? get() = (columnType as? AutoIncColumnType) ?: (columnType as? EntityIDColumnType<*>)?.idColumn?.columnType as? AutoIncColumnType -@Deprecated( - message = "Will be removed in upcoming releases. Please use [autoIncColumnType.autoincSeq] instead", - replaceWith = ReplaceWith("this.autoIncColumnType.autoincSeq"), - level = DeprecationLevel.HIDDEN -) -val Column<*>.autoIncSeqName: String? - get() = autoIncColumnType?.autoincSeq - internal fun IColumnType.rawSqlType(): IColumnType = when { this is AutoIncColumnType -> delegate this is EntityIDColumnType<*> && idColumn.columnType is AutoIncColumnType -> idColumn.columnType.delegate diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Database.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Database.kt index c9c6c34852..7fd562c959 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Database.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Database.kt @@ -144,26 +144,6 @@ class Database private constructor( ) } - @Deprecated( - level = DeprecationLevel.HIDDEN, - replaceWith = ReplaceWith("connectPool(datasource, setupConnection, manager)"), - message = "Use connectPool instead" - ) - fun connect( - datasource: ConnectionPoolDataSource, - setupConnection: (Connection) -> Unit = {}, - databaseConfig: DatabaseConfig? = null, - manager: (Database) -> TransactionManager = { ThreadLocalTransactionManager(it) } - ): Database { - return doConnect( - explicitVendor = null, - config = databaseConfig, - getNewConnection = { datasource.pooledConnection.connection!! }, - setupConnection = setupConnection, - manager = manager - ) - } - fun connectPool( datasource: ConnectionPoolDataSource, setupConnection: (Connection) -> Unit = {}, diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Op.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Op.kt index b42e4750c1..a5e2d555b7 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Op.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Op.kt @@ -525,10 +525,10 @@ class LikeEscapeOp(expr1: Expression<*>, expr2: Expression<*>, like: Boolean, va } } -@Deprecated("Use LikeEscapeOp", replaceWith = ReplaceWith("LikeEscapeOp(expr1, expr2, true, null)"), level = DeprecationLevel.WARNING) +@Deprecated("Use LikeEscapeOp", replaceWith = ReplaceWith("LikeEscapeOp(expr1, expr2, true, null)"), DeprecationLevel.ERROR) class LikeOp(expr1: Expression<*>, expr2: Expression<*>) : ComparisonOp(expr1, expr2, "LIKE") -@Deprecated("Use LikeEscapeOp", replaceWith = ReplaceWith("LikeEscapeOp(expr1, expr2, false, null)"), level = DeprecationLevel.WARNING) +@Deprecated("Use LikeEscapeOp", replaceWith = ReplaceWith("LikeEscapeOp(expr1, expr2, false, null)"), DeprecationLevel.ERROR) class NotLikeOp(expr1: Expression<*>, expr2: Expression<*>) : ComparisonOp(expr1, expr2, "NOT LIKE") /** diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SQLExpressionBuilder.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SQLExpressionBuilder.kt index 50be5d5e52..c3f849e10a 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SQLExpressionBuilder.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SQLExpressionBuilder.kt @@ -129,7 +129,7 @@ inline fun ExpressionWithColumnType<*>.jsonExtract(vararg path // Sequence Manipulation Functions /** Advances this sequence and returns the new value. */ -@Deprecated("please use [nextIntVal] or [nextLongVal] functions", ReplaceWith("nextIntVal()"), DeprecationLevel.ERROR) +@Deprecated("Please use [nextIntVal] or [nextLongVal] functions", ReplaceWith("nextIntVal()"), DeprecationLevel.WARNING) fun Sequence.nextVal(): NextVal = nextIntVal() /** Advances this sequence and returns the new value. */ @@ -216,7 +216,7 @@ data class LikePattern( } } -@Deprecated("Implement interface ISqlExpressionBuilder instead inherit this class", level = DeprecationLevel.ERROR) +@Deprecated("Implement interface ISqlExpressionBuilder directly instead", level = DeprecationLevel.HIDDEN) open class SqlExpressionBuilderClass : ISqlExpressionBuilder @Suppress("INAPPLICABLE_JVM_NAME", "TooManyFunctions") diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SchemaUtils.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SchemaUtils.kt index e8035e7cfc..e29b1ec9fe 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SchemaUtils.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SchemaUtils.kt @@ -121,7 +121,7 @@ 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.ERROR + DeprecationLevel.HIDDEN ) fun createFKey(reference: Column<*>): List { val foreignKey = reference.foreignKey diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/StatementInterceptor.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/StatementInterceptor.kt index cf53392ca1..58422e447d 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/StatementInterceptor.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/StatementInterceptor.kt @@ -20,15 +20,13 @@ interface StatementInterceptor { fun beforeCommit(transaction: Transaction) {} - @Deprecated("using afterCommit with transaction", level = DeprecationLevel.ERROR) - // @Deprecated("using afterCommit with transaction", level = DeprecationLevel.HIDDEN) \\ next version, backward compatibility + @Deprecated("Use afterCommit() with a transaction", level = DeprecationLevel.HIDDEN) fun afterCommit() {} fun afterCommit(transaction: Transaction) {} fun beforeRollback(transaction: Transaction) {} - @Deprecated("using afterRollback with transaction", level = DeprecationLevel.ERROR) - // @Deprecated("using afterRollback with transaction", level = DeprecationLevel.HIDDEN) \\ next version, backward compatibility + @Deprecated("Use afterRollback() with a transaction", level = DeprecationLevel.HIDDEN) fun afterRollback() {} fun afterRollback(transaction: Transaction) {} diff --git a/exposed-java-time/api/exposed-java-time.api b/exposed-java-time/api/exposed-java-time.api index 9be1b89cce..3e6f0f1101 100644 --- a/exposed-java-time/api/exposed-java-time.api +++ b/exposed-java-time/api/exposed-java-time.api @@ -5,7 +5,7 @@ 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 fun invoke ()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 } diff --git a/exposed-java-time/src/main/kotlin/org/jetbrains/exposed/sql/javatime/JavaDateFunctions.kt b/exposed-java-time/src/main/kotlin/org/jetbrains/exposed/sql/javatime/JavaDateFunctions.kt index 60bd11c081..bdbf099a8e 100644 --- a/exposed-java-time/src/main/kotlin/org/jetbrains/exposed/sql/javatime/JavaDateFunctions.kt +++ b/exposed-java-time/src/main/kotlin/org/jetbrains/exposed/sql/javatime/JavaDateFunctions.kt @@ -31,10 +31,9 @@ object CurrentDateTime : Function(JavaLocalDateTimeColumnType.INS } @Deprecated( - message = "This class is now a singleton, no need for its constructor call; " + - "this method is provided for backward-compatibility only, and will be removed in future releases", + message = "This class is now a singleton, no need for its constructor call", replaceWith = ReplaceWith("this"), - level = DeprecationLevel.ERROR, + level = DeprecationLevel.HIDDEN, ) operator fun invoke() = this } diff --git a/exposed-jodatime/api/exposed-jodatime.api b/exposed-jodatime/api/exposed-jodatime.api index 2990c6dc4d..3b47e710bf 100644 --- a/exposed-jodatime/api/exposed-jodatime.api +++ b/exposed-jodatime/api/exposed-jodatime.api @@ -5,7 +5,7 @@ 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 fun invoke ()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 } diff --git a/exposed-jodatime/src/main/kotlin/org/jetbrains/exposed/sql/jodatime/DateFunctions.kt b/exposed-jodatime/src/main/kotlin/org/jetbrains/exposed/sql/jodatime/DateFunctions.kt index da9c554863..ef6e1c5131 100644 --- a/exposed-jodatime/src/main/kotlin/org/jetbrains/exposed/sql/jodatime/DateFunctions.kt +++ b/exposed-jodatime/src/main/kotlin/org/jetbrains/exposed/sql/jodatime/DateFunctions.kt @@ -22,10 +22,9 @@ object CurrentDateTime : Function(DateColumnType(true)) { } @Deprecated( - message = "This class is now a singleton, no need for its constructor call; " + - "this method is provided for backward-compatibility only, and will be removed in future releases", + message = "This class is now a singleton, no need for its constructor call", replaceWith = ReplaceWith("this"), - level = DeprecationLevel.ERROR, + level = DeprecationLevel.HIDDEN, ) operator fun invoke() = this } diff --git a/exposed-kotlin-datetime/api/exposed-kotlin-datetime.api b/exposed-kotlin-datetime/api/exposed-kotlin-datetime.api index e36c08cdad..dc434d4506 100644 --- a/exposed-kotlin-datetime/api/exposed-kotlin-datetime.api +++ b/exposed-kotlin-datetime/api/exposed-kotlin-datetime.api @@ -5,7 +5,7 @@ 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 fun invoke ()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 } diff --git a/exposed-kotlin-datetime/src/main/kotlin/org/jetbrains/exposed/sql/kotlin/datetime/KotlinDateFunctions.kt b/exposed-kotlin-datetime/src/main/kotlin/org/jetbrains/exposed/sql/kotlin/datetime/KotlinDateFunctions.kt index 4d502f5db9..b144460baf 100644 --- a/exposed-kotlin-datetime/src/main/kotlin/org/jetbrains/exposed/sql/kotlin/datetime/KotlinDateFunctions.kt +++ b/exposed-kotlin-datetime/src/main/kotlin/org/jetbrains/exposed/sql/kotlin/datetime/KotlinDateFunctions.kt @@ -14,7 +14,6 @@ import org.jetbrains.exposed.sql.vendors.SQLServerDialect import org.jetbrains.exposed.sql.vendors.currentDialect import org.jetbrains.exposed.sql.vendors.h2Mode import kotlin.time.Duration -import kotlin.time.ExperimentalTime internal class DateInternal(val expr: Expression<*>) : Function(KotlinLocalDateColumnType.INSTANCE) { override fun toQueryBuilder(queryBuilder: QueryBuilder) = queryBuilder { append("DATE(", expr, ")") } @@ -47,10 +46,9 @@ object CurrentDateTime : Function(KotlinLocalDateTimeColumnType.I } @Deprecated( - message = "This class is now a singleton, no need for its constructor call; " + - "this method is provided for backward-compatibility only, and will be removed in future releases", + message = "This class is now a singleton, no need for its constructor call", replaceWith = ReplaceWith("this"), - level = DeprecationLevel.ERROR, + level = DeprecationLevel.HIDDEN, ) operator fun invoke() = this } From e7423649d47bcc3a7445b598ad4b7676d2d20e13 Mon Sep 17 00:00:00 2001 From: Chantal Loncle <82039410+bog-walk@users.noreply.github.com> Date: Sun, 25 Jun 2023 22:55:05 -0400 Subject: [PATCH 2/4] Add missing apiDump file --- exposed-dao/api/exposed-dao.api | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exposed-dao/api/exposed-dao.api b/exposed-dao/api/exposed-dao.api index 9adc36989b..73a2e4fad7 100644 --- a/exposed-dao/api/exposed-dao.api +++ b/exposed-dao/api/exposed-dao.api @@ -185,10 +185,10 @@ public final class org/jetbrains/exposed/dao/EntityHookKt { public final class org/jetbrains/exposed/dao/EntityLifecycleInterceptor : org/jetbrains/exposed/sql/statements/GlobalStatementInterceptor { public fun ()V - public fun afterCommit ()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 fun afterRollback ()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 From b2aa627d4aa2a7bf89218b72059e44487d5552a4 Mon Sep 17 00:00:00 2001 From: Chantal Loncle <82039410+bog-walk@users.noreply.github.com> Date: Sun, 25 Jun 2023 23:12:40 -0400 Subject: [PATCH 3/4] Add missing apiDump file --- exposed-core/api/exposed-core.api | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exposed-core/api/exposed-core.api b/exposed-core/api/exposed-core.api index b19685804f..c0b8eda6b5 100644 --- a/exposed-core/api/exposed-core.api +++ b/exposed-core/api/exposed-core.api @@ -448,10 +448,10 @@ public abstract class org/jetbrains/exposed/sql/CompositeColumn : org/jetbrains/ public final class org/jetbrains/exposed/sql/CompositeSqlLogger : org/jetbrains/exposed/sql/SqlLogger, org/jetbrains/exposed/sql/statements/StatementInterceptor { public fun ()V public final fun addLogger (Lorg/jetbrains/exposed/sql/SqlLogger;)V - public fun afterCommit ()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 fun afterRollback ()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 From ddf3f5cc1fbd7371cd9cdea193a272ba400fc1c1 Mon Sep 17 00:00:00 2001 From: Chantal Loncle <82039410+bog-walk@users.noreply.github.com> Date: Sun, 25 Jun 2023 23:28:38 -0400 Subject: [PATCH 4/4] deprecate: EXPOSED-84 Raise deprecation levels of API elements Fix incorrect level change in SQLExpressionBuilder & update api file. --- exposed-core/api/exposed-core.api | 2 +- .../kotlin/org/jetbrains/exposed/sql/SQLExpressionBuilder.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exposed-core/api/exposed-core.api b/exposed-core/api/exposed-core.api index c0b8eda6b5..4aa507081c 100644 --- a/exposed-core/api/exposed-core.api +++ b/exposed-core/api/exposed-core.api @@ -1617,7 +1617,7 @@ public final class org/jetbrains/exposed/sql/SQLExpressionBuilderKt { public static final fun min (Lorg/jetbrains/exposed/sql/ExpressionWithColumnType;)Lorg/jetbrains/exposed/sql/Min; public static final fun nextIntVal (Lorg/jetbrains/exposed/sql/Sequence;)Lorg/jetbrains/exposed/sql/NextVal; public static final fun nextLongVal (Lorg/jetbrains/exposed/sql/Sequence;)Lorg/jetbrains/exposed/sql/NextVal; - public static final fun nextVal (Lorg/jetbrains/exposed/sql/Sequence;)Lorg/jetbrains/exposed/sql/NextVal; + public static final synthetic fun nextVal (Lorg/jetbrains/exposed/sql/Sequence;)Lorg/jetbrains/exposed/sql/NextVal; public static final fun stdDevPop (Lorg/jetbrains/exposed/sql/ExpressionWithColumnType;I)Lorg/jetbrains/exposed/sql/StdDevPop; public static synthetic fun stdDevPop$default (Lorg/jetbrains/exposed/sql/ExpressionWithColumnType;IILjava/lang/Object;)Lorg/jetbrains/exposed/sql/StdDevPop; public static final fun stdDevSamp (Lorg/jetbrains/exposed/sql/ExpressionWithColumnType;I)Lorg/jetbrains/exposed/sql/StdDevSamp; diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SQLExpressionBuilder.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SQLExpressionBuilder.kt index c3f849e10a..c57affcb1f 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SQLExpressionBuilder.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SQLExpressionBuilder.kt @@ -129,7 +129,7 @@ inline fun ExpressionWithColumnType<*>.jsonExtract(vararg path // Sequence Manipulation Functions /** Advances this sequence and returns the new value. */ -@Deprecated("Please use [nextIntVal] or [nextLongVal] functions", ReplaceWith("nextIntVal()"), DeprecationLevel.WARNING) +@Deprecated("Please use [nextIntVal] or [nextLongVal] functions", ReplaceWith("nextIntVal()"), DeprecationLevel.HIDDEN) fun Sequence.nextVal(): NextVal = nextIntVal() /** Advances this sequence and returns the new value. */