feat: Add QuerySpec-based createOrUpdate method Overloads to DAOs - #154
Open
abhinow-porwal wants to merge 1 commit into
Open
feat: Add QuerySpec-based createOrUpdate method Overloads to DAOs#154abhinow-porwal wants to merge 1 commit into
abhinow-porwal wants to merge 1 commit into
Conversation
r0goyal
reviewed
Apr 22, 2026
|
|
||
| @Override | ||
| public OpType getOpType() { | ||
| return OpType.CREATE_OR_UPDATE; |
Collaborator
There was a problem hiding this comment.
This should have a new value ?
abhinow-porwal
pushed a commit
to abhinow-porwal/dropwizard-db-sharding-bundle
that referenced
this pull request
May 7, 2026
Addresses PR santanusinha#154 review feedback by adding complete test coverage: Unit Tests: - CreateOrUpdateByQuerySpecTest with 3 tests covering: - Entity creation path (when entity doesn't exist) - Entity update path (when entity exists) - Null entityGenerator handling Integration Tests: - MultiTenantRelationalDaoTest: 2 new tests - testCreateOrUpdateWithQuerySpec (creation and update paths) - testMultiShardRunWithQuerySpec (1000 entities across shards) - RelationalDaoTest: 2 new tests - testCreateOrUpdateWithQuerySpec (wrapper method) - testRunWithQuerySpec (multi-shard queries) Code Quality Fixes: - Fixed indentation in MultiTenantRelationalDao (lines 150-160) - Added JavaDoc to get(QuerySpec) method - Enhanced JavaDoc in CreateOrUpdateByQuerySpec documenting null behavior - Fixed OpType to use CREATE_OR_UPDATE_BY_QUERY_SPEC - Minor cleanup in OpContext Test Results: 298 tests passing, 0 failures, 0 regressions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
abhinow-porwal
marked this pull request as ready for review
May 7, 2026 06:40
abhinow-porwal
force-pushed
the
feature/add_remaining_queryspec
branch
3 times, most recently
from
May 7, 2026 12:24
c6c2268 to
9bafa46
Compare
Add QuerySpec support for createOrUpdate operations in RelationalDao and MultiTenantRelationalDao alongside existing DetachedCriteria methods. - New CreateOrUpdateByQuerySpec operation with visitor pattern support - BucketKeyPersistor integration for automatic bucket ID injection - Comprehensive unit and integration tests (296 passing)
abhinow-porwal
force-pushed
the
feature/add_remaining_queryspec
branch
from
May 7, 2026 12:29
9bafa46 to
f4af4d1
Compare
|
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.



Summary
Adds QuerySpec-based
createOrUpdatemethods toRelationalDaoandMultiTenantRelationalDaoalongside existingDetachedCriteriaversions.Changes
CreateOrUpdateByQuerySpecoperation class with complete visitor pattern supportcreateOrUpdate(QuerySpec)method overloads in both DAO classesBucketKeyPersistorvisitor implementation for automatic bucket ID injectionCREATE_OR_UPDATE_BY_QUERY_SPECadded toOpTypeenumTests
CreateOrUpdateByQuerySpecTest- unit tests covering creation, update, and null edge casesMultiTenantRelationalDaoTest.testCreateOrUpdateWithQuerySpec()- integration testRelationalDaoTest.testCreateOrUpdateWithQuerySpec()- integration testAll 296 tests passing, zero regressions.