Migrate JdbcTokenRepositoryImpl to JdbcPersistentTokenRepository#19163
Open
therepanic wants to merge 1 commit into
Open
Migrate JdbcTokenRepositoryImpl to JdbcPersistentTokenRepository#19163therepanic wants to merge 1 commit into
JdbcTokenRepositoryImpl to JdbcPersistentTokenRepository#19163therepanic wants to merge 1 commit into
Conversation
Since `JdbcDaoSupport` has been deprecated, we should deprecate our implementation of `JdbcTokenRepositoryImpl`, which directly inherits from `JdbcDaoSupport`. Instead of using `JdbcDaoSupport`, we are advised to inject `JdbcTemplate` or `JdbcClient` into the field, so we should create a new implementation of `JdbcPersistentTokenRepository`. References: spring-projectsgh-18982 Closes: spring-projectsgh-18987, spring-projectsgh-18986 Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
therepanic
commented
May 9, 2026
Comment on lines
+69
to
+85
|
|
||
| private final JdbcClient jdbcClient; | ||
|
|
||
| protected final Log logger = LogFactory.getLog(this.getClass()); | ||
|
|
||
| public JdbcPersistentTokenRepository(JdbcClient jdbcClient) { | ||
| this.jdbcClient = jdbcClient; | ||
| } | ||
|
|
||
| public JdbcPersistentTokenRepository(DataSource dataSource) { | ||
| this.jdbcClient = JdbcClient.create(dataSource); | ||
| } | ||
|
|
||
| public JdbcPersistentTokenRepository(JdbcTemplate jdbcTemplate) { | ||
| this.jdbcClient = JdbcClient.create(jdbcTemplate); | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
This is a great opportunity for us to start using the new JdbcClient API, which is fully compatible with the existing JdbcClient. Nice!
therepanic
commented
May 9, 2026
Comment on lines
+39
to
41
| @Deprecated(since = "7.1.0") | ||
| @SuppressWarnings("removal") | ||
| public class JdbcTokenRepositoryImpl extends JdbcDaoSupport implements PersistentTokenRepository { |
Contributor
Author
There was a problem hiding this comment.
I didn't mark it as "forRemoval" because otherwise the build would fail.
Contributor
Author
|
I don't think the 8.0.0 branch is available yet to remove |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since
JdbcDaoSupporthas been deprecated, we should deprecate our implementation ofJdbcTokenRepositoryImpl, which directly inherits fromJdbcDaoSupport. Instead of usingJdbcDaoSupport, we are advised to injectJdbcTemplateorJdbcClientinto the field, so we should create a new implementation ofJdbcPersistentTokenRepository.References: gh-18982
Closes: gh-18987
Closes: gh-18986