diff --git a/buildSrc/src/main/kotlin/org/jetbrains/exposed/gradle/Versions.kt b/buildSrc/src/main/kotlin/org/jetbrains/exposed/gradle/Versions.kt deleted file mode 100644 index 5e87e29efc..0000000000 --- a/buildSrc/src/main/kotlin/org/jetbrains/exposed/gradle/Versions.kt +++ /dev/null @@ -1,27 +0,0 @@ -package org.jetbrains.exposed.gradle - -@Deprecated("Use gradle version catalog", level = DeprecationLevel.ERROR) -object Versions { - const val kotlinCoroutines = "1.7.3" - const val kotlinxSerialization = "1.5.1" - - const val slf4j = "1.7.36" - const val log4j2 = "2.20.0" - - /** JDBC drivers **/ - const val h2 = "1.4.200" - const val h2_v2 = "2.2.220" - const val mariaDB_v2 = "2.7.9" - const val mariaDB_v3 = "3.1.4" - const val mysql51 = "5.1.49" - const val mysql80 = "8.0.33" - const val oracle12 = "12.2.0.1" - const val postgre = "42.6.0" - const val postgreNG = "0.8.9" - const val sqlite3 = "3.43.0.0" - const val sqlserver = "9.4.1.jre8" - - /** Spring **/ - const val springFramework = "6.0.11" - const val springBoot = "3.1.3" -} diff --git a/exposed-core/api/exposed-core.api b/exposed-core/api/exposed-core.api index e7661c15ea..eb1ec65ab5 100644 --- a/exposed-core/api/exposed-core.api +++ b/exposed-core/api/exposed-core.api @@ -3461,7 +3461,6 @@ public abstract class org/jetbrains/exposed/sql/statements/api/ExposedDatabaseMe public abstract fun columns ([Lorg/jetbrains/exposed/sql/Table;)Ljava/util/Map; public abstract fun existingIndices ([Lorg/jetbrains/exposed/sql/Table;)Ljava/util/Map; public abstract fun existingPrimaryKeys ([Lorg/jetbrains/exposed/sql/Table;)Ljava/util/Map; - public abstract synthetic fun getCurrentScheme ()Ljava/lang/String; public final fun getDatabase ()Ljava/lang/String; public abstract fun getDatabaseDialectName ()Ljava/lang/String; public abstract fun getDatabaseProductVersion ()Ljava/lang/String; 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 b80f756ac7..6ccd701b1c 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 @@ -214,7 +214,7 @@ class Database private constructor( */ @Deprecated( message = "Use Database.connect() with a connection pool DataSource instead. This may be removed in future releases.", - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) fun connectPool( datasource: ConnectionPoolDataSource, diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/DatabaseConfig.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/DatabaseConfig.kt index 33a783d3c6..3d1d74ff0f 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/DatabaseConfig.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/DatabaseConfig.kt @@ -20,19 +20,19 @@ class DatabaseConfig private constructor( @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("defaultMaxAttempts"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) val defaultRepetitionAttempts: Int, @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("defaultMinRetryDelay"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) val defaultMinRepetitionDelay: Long, @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("defaultMaxRetryDelay"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) val defaultMaxRepetitionDelay: Long, val defaultReadOnly: Boolean, @@ -140,7 +140,7 @@ class DatabaseConfig private constructor( @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("defaultMaxAttempts"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) var defaultRepetitionAttempts: Int get() = defaultMaxAttempts @@ -149,7 +149,7 @@ class DatabaseConfig private constructor( @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("defaultMinRetryDelay"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) var defaultMinRepetitionDelay: Long get() = defaultMinRetryDelay @@ -158,7 +158,7 @@ class DatabaseConfig private constructor( @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("defaultMaxRetryDelay"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) var defaultMaxRepetitionDelay: Long get() = defaultMaxRetryDelay diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt index 0bdc006c53..dcbac4549e 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt @@ -11,7 +11,7 @@ import kotlin.sequences.Sequence @Deprecated( message = "As part of SELECT DSL design changes, this will be removed in future releases.", replaceWith = ReplaceWith("selectAll().where { where.invoke() }", "import org.jetbrains.exposed.sql.selectAll"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) inline fun FieldSet.select(where: SqlExpressionBuilder.() -> Op): Query = Query(this, SqlExpressionBuilder.where()) @@ -26,7 +26,7 @@ inline fun Query.select(where: SqlExpressionBuilder.() -> Op): Query = @Deprecated( message = "As part of SELECT DSL design changes, this will be removed in future releases.", replaceWith = ReplaceWith("selectAll().where(where)", "import org.jetbrains.exposed.sql.selectAll"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) fun FieldSet.select(where: Op): Query = Query(this, where) @@ -53,7 +53,7 @@ fun FieldSet.selectAll(): Query = Query(this, null) "selectAll().where { where.invoke() }.fetchBatchedResults(batchSize)", "import org.jetbrains.exposed.sql.selectAll" ), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) fun FieldSet.selectBatched( batchSize: Int = 1000, @@ -80,7 +80,7 @@ fun Query.selectBatched( "selectAll().fetchBatchedResults(batchSize)", "import org.jetbrains.exposed.sql.selectAll" ), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) fun FieldSet.selectAllBatched( batchSize: Int = 1000 diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Query.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Query.kt index 3bfc4a0145..e2f8ee514c 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Query.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Query.kt @@ -83,7 +83,7 @@ open class Query(override var set: FieldSet, where: Op?) : AbstractQuer @Deprecated( message = "As part of SELECT DSL design changes, this will be removed in future releases.", replaceWith = ReplaceWith("adjustSelect { body.invoke() }"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) fun adjustSlice(body: ColumnSet.(FieldSet) -> FieldSet): Query = apply { set = set.source.body(set) } diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Table.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Table.kt index 53b20a2b00..e84a25cdb7 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Table.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Table.kt @@ -111,14 +111,14 @@ abstract class ColumnSet : FieldSet { @Deprecated( message = "As part of SELECT DSL design changes, this will be removed in future releases.", replaceWith = ReplaceWith("select(column, *columns)"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) fun slice(column: Expression<*>, vararg columns: Expression<*>): FieldSet = Slice(this, listOf(column) + columns) @Deprecated( message = "As part of SELECT DSL design changes, this will be removed in future releases.", replaceWith = ReplaceWith("select(columns)"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) fun slice(columns: List>): FieldSet = Slice(this, columns) diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Transaction.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Transaction.kt index fb6b9b59a1..8fa9d4317c 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Transaction.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Transaction.kt @@ -87,7 +87,7 @@ open class Transaction( @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("maxAttempts"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) var repetitionAttempts: Int get() = maxAttempts @@ -96,7 +96,7 @@ open class Transaction( @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("minRetryDelay"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) var minRepetitionDelay: Long get() = minRetryDelay @@ -105,7 +105,7 @@ open class Transaction( @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("maxRetryDelay"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) var maxRepetitionDelay: Long get() = maxRetryDelay diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/api/ExposedDatabaseMetadata.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/api/ExposedDatabaseMetadata.kt index 17af9eb11e..117d3d64d4 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/api/ExposedDatabaseMetadata.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/api/ExposedDatabaseMetadata.kt @@ -36,12 +36,6 @@ abstract class ExposedDatabaseMetadata(val database: String) { /** Whether the database supports `SELECT FOR UPDATE` statements. */ abstract val supportsSelectForUpdate: Boolean - @Deprecated( - message = "it's temporary solution which will be replaced in a future releases. Do not use it in your code", - level = DeprecationLevel.HIDDEN - ) - abstract val currentScheme: String - /** Clears and resets any stored information about the database's current schema to default values. */ abstract fun resetCurrentScheme() diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/transactions/ThreadLocalTransactionManager.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/transactions/ThreadLocalTransactionManager.kt index b65218c933..8e8b86e772 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/transactions/ThreadLocalTransactionManager.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/transactions/ThreadLocalTransactionManager.kt @@ -34,7 +34,7 @@ class ThreadLocalTransactionManager( @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("defaultMaxAttempts"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) override var defaultRepetitionAttempts: Int get() = defaultMaxAttempts @@ -43,7 +43,7 @@ class ThreadLocalTransactionManager( @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("defaultMinRetryDelay"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) override var defaultMinRepetitionDelay: Long get() = defaultMinRetryDelay @@ -52,7 +52,7 @@ class ThreadLocalTransactionManager( @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("defaultMaxRetryDelay"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) override var defaultMaxRepetitionDelay: Long get() = defaultMaxRetryDelay diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/transactions/TransactionApi.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/transactions/TransactionApi.kt index 2f9a0dda0a..04873a540e 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/transactions/TransactionApi.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/transactions/TransactionApi.kt @@ -45,13 +45,13 @@ private object NotInitializedManager : TransactionManager { override var defaultMaxRetryDelay: Long = 0 - @Deprecated("This will be removed when the interface property is fully deprecated", level = DeprecationLevel.WARNING) + @Deprecated("This will be removed when the interface property is fully deprecated", level = DeprecationLevel.ERROR) override var defaultRepetitionAttempts: Int = -1 - @Deprecated("This will be removed when the interface property is fully deprecated", level = DeprecationLevel.WARNING) + @Deprecated("This will be removed when the interface property is fully deprecated", level = DeprecationLevel.ERROR) override var defaultMinRepetitionDelay: Long = 0 - @Deprecated("This will be removed when the interface property is fully deprecated", level = DeprecationLevel.WARNING) + @Deprecated("This will be removed when the interface property is fully deprecated", level = DeprecationLevel.ERROR) override var defaultMaxRepetitionDelay: Long = 0 override fun newTransaction(isolation: Int, readOnly: Boolean, outerTransaction: Transaction?): Transaction = @@ -87,21 +87,21 @@ interface TransactionManager { @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("defaultMaxAttempts"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) var defaultRepetitionAttempts: Int @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("defaultMinRetryDelay"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) var defaultMinRepetitionDelay: Long @Deprecated( message = "This property will be removed in future releases", replaceWith = ReplaceWith("defaultMaxRetryDelay"), - level = DeprecationLevel.WARNING + level = DeprecationLevel.ERROR ) var defaultMaxRepetitionDelay: Long diff --git a/exposed-jdbc/api/exposed-jdbc.api b/exposed-jdbc/api/exposed-jdbc.api index 0884efd562..9e62e8b9fa 100644 --- a/exposed-jdbc/api/exposed-jdbc.api +++ b/exposed-jdbc/api/exposed-jdbc.api @@ -38,7 +38,6 @@ public final class org/jetbrains/exposed/sql/statements/jdbc/JdbcDatabaseMetadat public fun columns ([Lorg/jetbrains/exposed/sql/Table;)Ljava/util/Map; public fun existingIndices ([Lorg/jetbrains/exposed/sql/Table;)Ljava/util/Map; public fun existingPrimaryKeys ([Lorg/jetbrains/exposed/sql/Table;)Ljava/util/Map; - public synthetic fun getCurrentScheme ()Ljava/lang/String; public fun getDatabaseDialectName ()Ljava/lang/String; public fun getDatabaseProductVersion ()Ljava/lang/String; public fun getDefaultIsolationLevel ()I diff --git a/exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/sql/statements/jdbc/JdbcDatabaseMetadataImpl.kt b/exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/sql/statements/jdbc/JdbcDatabaseMetadataImpl.kt index 62b4ddf992..adbc74826e 100644 --- a/exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/sql/statements/jdbc/JdbcDatabaseMetadataImpl.kt +++ b/exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/sql/statements/jdbc/JdbcDatabaseMetadataImpl.kt @@ -75,12 +75,6 @@ class JdbcDatabaseMetadataImpl(database: String, val metadata: DatabaseMetaData) return field!! } - @Deprecated( - message = "This will be removed when the interface property is fully deprecated", - level = DeprecationLevel.HIDDEN - ) - override val currentScheme: String get() = currentSchema!! - override fun resetCurrentScheme() { currentSchema = null } diff --git a/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/dml/SelectTests.kt b/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/dml/SelectTests.kt index 44d13c24b3..6559950f4a 100644 --- a/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/dml/SelectTests.kt +++ b/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/dml/SelectTests.kt @@ -1,6 +1,5 @@ package org.jetbrains.exposed.sql.tests.shared.dml -import nl.altindag.log.LogCaptor import org.jetbrains.exposed.dao.id.IntIdTable import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.tests.DatabaseTestsBase @@ -9,62 +8,9 @@ import org.jetbrains.exposed.sql.tests.shared.assertEquals import org.jetbrains.exposed.sql.tests.shared.entities.EntityTests import org.jetbrains.exposed.sql.tests.shared.expectException import org.junit.Test -import kotlin.test.assertContentEquals import kotlin.test.assertNull class SelectTests : DatabaseTestsBase() { - @Test - fun testMigrationToNewQueryDSL() { - withCitiesAndUsers { cities, _, _ -> - val logCaptor = LogCaptor.forName(exposedLogger.name) - logCaptor.setLogLevelToDebug() - - // old query dsl - cities.slice(cities.name).select { cities.name eq "andrey" }.toList() - cities.slice(cities.name).select(Op.TRUE).toList() - cities.slice(cities.name).selectAll().toList() - - cities.select { cities.name eq "andrey" }.toList() - cities.select(Op.TRUE).toList() - cities.selectAll().toList() - - cities.slice(cities.name).selectBatched(50) { cities.name eq "andrey" }.toList() - cities.slice(cities.name).selectAllBatched(50).toList() - cities.selectBatched(50) { cities.name eq "andrey" }.toList() - cities.selectAllBatched(50).toList() - - val originalQuery1 = cities.select { cities.name eq "andrey" }.also { it.toList() } - originalQuery1.adjustSlice { slice(cities.name) }.toList() - - val sqlLoggedWithOldDSL = logCaptor.debugLogs.toList() - logCaptor.clearLogs() - - // new query dsl - cities.select(cities.name).where { cities.name eq "andrey" }.toList() - cities.select(cities.name).where(Op.TRUE).toList() - cities.select(cities.name).toList() - - cities.selectAll().where { cities.name eq "andrey" }.toList() - cities.selectAll().where(Op.TRUE).toList() - cities.selectAll().toList() - - cities.select(cities.name).where { cities.name eq "andrey" }.fetchBatchedResults(50).toList() - cities.select(cities.name).fetchBatchedResults(50).toList() - cities.selectAll().where { cities.name eq "andrey" }.fetchBatchedResults(50).toList() - cities.selectAll().fetchBatchedResults(50).toList() - - val originalQuery2 = cities.selectAll().where { cities.name eq "andrey" }.also { it.toList() } - originalQuery2.adjustSelect { select(cities.name) }.toList() - - val sqlLoggedWithNewDSL = logCaptor.debugLogs.toList() - logCaptor.clearLogs() - logCaptor.resetLogLevel() - logCaptor.close() - - assertContentEquals(sqlLoggedWithOldDSL, sqlLoggedWithNewDSL) - } - } - @Test fun testSelect() { withCitiesAndUsers { _, users, _ ->