-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Closed
Labels
in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)status: duplicateA duplicate of another issueA duplicate of another issuetype: enhancementA general enhancementA general enhancement
Description
It is necessary to improve the way of fetching entities from the database in accordance with the pattern suggested by @jzheaux , using the example of JdbcPublicKeyCredentialUserEntityRepository:
if (existsUserEntity) {
updateUserEntity(userEntity);
}
else {
try {
insertUserEntity(userEntity);
}
catch (DuplicateKeyException ex) {
updateUserEntity(userEntity);
}
}
Thic code can be replaced by:
int rows = updateUserEntity(userEntity);
if (rows == 0) {
insertUserEntity(userEntity);
}
This polish can be done in the following components:
JdbcOAuth2AuthorizedClientServicemethodsaveAuthorizedClientJdbcUserCredentialRepositorymethodsave
If possible, tests should be left as is.
Metadata
Metadata
Assignees
Labels
in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)status: duplicateA duplicate of another issueA duplicate of another issuetype: enhancementA general enhancementA general enhancement