fix: illogic when ruleCode exists but not found in database#63
Merged
jietian-sts merged 1 commit intoantgroup:mainfrom Aug 13, 2025
Merged
fix: illogic when ruleCode exists but not found in database#63jietian-sts merged 1 commit intoantgroup:mainfrom
jietian-sts merged 1 commit intoantgroup:mainfrom
Conversation
Contributor
|
Important Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR amends the saveOrgRule method in RuleRepositoryImpl to insert a new rule record whenever a non‐empty ruleCode is provided but no corresponding database entry exists, closing the gap that previously led to orphaned related records. Sequence diagram for updated saveOrgRule logic when ruleCode exists but not in databasesequenceDiagram
participant Service as RuleRepositoryImpl
participant DB as Database
participant Mapper as ruleMapper
Service->>DB: Check if ruleCode exists
alt ruleCode exists in DB
Service->>Mapper: updateByPrimaryKeySelective(rulePO)
else ruleCode does not exist in DB
Service->>Mapper: insertSelective(rulePO)
end
Class diagram for updated RuleRepositoryImpl.saveOrgRule logicclassDiagram
class RuleRepositoryImpl {
+void saveOrgRule(RuleAgg ruleAgg)
}
class ruleMapper {
+void updateByPrimaryKeySelective(rulePO)
+void insertSelective(rulePO)
}
RuleRepositoryImpl --> ruleMapper
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @Center-Sun - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Collaborator
|
LGTM |
jietian-sts
approved these changes
Aug 13, 2025
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.
Thank you for your contribution to CloudRec!
What About:
java)go)opa)Description:
There was a logic flaw in the
saveOrgRulemethod where rules with non-emptyruleCodebut not existing in the database were being skipped during the insertion process.Issue Details
ruleCodeis not empty but no corresponding record exists in the database, the rule should be insertedelsebranch to handle this scenarioinitRuleoperations where:ruletableSummary by Sourcery
Bug Fixes: