-
Notifications
You must be signed in to change notification settings - Fork 4.9k
[Improvement-17158] Support query by wrapper in BaseDao #17163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
c134d05 to
326997b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request refactors query methods by removing multiple dedicated methods (e.g. queryByCode variants) and consolidating them into a generic query-by-wrapper approach in the BaseDao. Key changes include removal of redundant mapper methods, conversion of query methods in WorkflowInstanceDaoImpl and BaseDao to use lambda-based wrappers, and corresponding adjustments in tests and service implementations for workflow instance queries.
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| dolphinscheduler-dao/* | Removed XML and mapper query methods and simplified DAO implementations |
| dolphinscheduler-api/* | Updated service and test layers to use the new wrapper-based query methods in place of deprecated ones |
| BaseDao.java, IDao.java | Adapted interface signatures to use Java Function-based query conditions |
Comments suppressed due to low confidence (1)
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/WorkerGroupServiceTest.java:255
- Instead of returning null for query methods in tests, return an empty list to align with expected non-null collection responses.
when(workflowInstanceDao.queryByCondition(Mockito.any())).thenReturn(null);
.../src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowInstanceServiceImpl.java
Outdated
Show resolved
Hide resolved
…/api/service/impl/WorkflowInstanceServiceImpl.java Co-authored-by: Copilot <[email protected]>
72db50b to
97f374a
Compare
|


Purpose of the pull request
close #17158
Avoid write a lot of method e.g.
queryByCode,queryByCodeAndVersion,queryByCodeAndVersionAndStatusBrief change log
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(or)
Pull Request Notice
Pull Request Notice
If your pull request contains incompatible change, you should also add it to
docs/docs/en/guide/upgrade/incompatible.md