From 096682c8183e0d2c47f3a8a59fc33ad4c725e225 Mon Sep 17 00:00:00 2001 From: "Andrey.Tarashevskiy" Date: Thu, 28 Jul 2022 22:14:44 +0300 Subject: [PATCH] Add Transaction to lifecycle hooks for #1530 (#1531) / Wrong methods fixed --- .../sql/statements/StatementInterceptor.kt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 1ceb0d6b11..8c6ced7143 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 @@ -8,21 +8,21 @@ interface StatementInterceptor { fun beforeExecution(transaction: Transaction, context: StatementContext) {} fun afterExecution(transaction: Transaction, contexts: List, executedStatement: PreparedStatementApi) {} - fun beforeCommit(transaction: Transaction) { beforeCommit() } - - @Deprecated("using beforeCommit with transaction") - //@Deprecated("using beforeCommit with transaction", level = DeprecationLevel.ERROR) \\ next version - //@Deprecated("using beforeCommit with transaction", level = DeprecationLevel.HIDDEN) \\ next version, backward compatibility - fun beforeCommit() {} - fun afterCommit(transaction: Transaction) { afterCommit() } + fun beforeCommit(transaction: Transaction) {} @Deprecated("using afterCommit with transaction") - //@Deprecated("using afterRollback with transaction", level = DeprecationLevel.ERROR) \\ next version - //@Deprecated("using afterRollback with transaction", level = DeprecationLevel.HIDDEN) \\ next version, backward compatibility + //@Deprecated("using afterCommit with transaction", level = DeprecationLevel.ERROR) \\ next version + //@Deprecated("using afterCommit with transaction", level = DeprecationLevel.HIDDEN) \\ next version, backward compatibility fun afterCommit() {} + fun afterCommit(transaction: Transaction) { afterCommit() } fun beforeRollback(transaction: Transaction) {} - fun afterRollback(transaction: Transaction) {} + + @Deprecated("using afterRollback with transaction") + //@Deprecated("using afterRollback with transaction", level = DeprecationLevel.ERROR) \\ next version + //@Deprecated("using afterRollback with transaction", level = DeprecationLevel.HIDDEN) \\ next version, backward compatibility + fun afterRollback() {} + fun afterRollback(transaction: Transaction) { afterRollback() } fun keepUserDataInTransactionStoreOnCommit(userData: Map, Any?>): Map, Any?> = emptyMap() }