-
Notifications
You must be signed in to change notification settings - Fork 21
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
PUT and PATCH APIs #244
Merged
Merged
PUT and PATCH APIs #244
Conversation
This file contains 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
- rename `update` methods to `partialUpdate` - wrap return types in `Optional`s - introduce new `update` methods
- implementations now declare `Map` as first parameter type of `patchExistingEntity` - deprecate old `patchExistingEntity` signature (with the `P`-type parameter)
adds 8 sonar issues regarding the deprecated signature
provide failsafes for cases where some data is sometimes nullable
wherever an entity class has relationships to other entities, a javadoc comment is created for its copy constructor stating said constructor will not include relationships in the resulting object there are two exceptions for this, `Customer` and `Salesperson` two entities which are completely tied to `Person`
… services include unit tests introduce 2 temporary sonar issues
…y service include unit tests introduce 1 temporary sonar issue
include unit tests introduce 1 temporary sonar issue
rename `persistEntityWithUpdatesFromPojo` to `flushPartialChanges` introduce two abstract methods to allow full data updates without altering ids
refactor `GenericEntity` and `GenericPojo` as inner static classes of the test class
set as base type in `org.trebol.jpa.Repository`
`extractIdFrom` and `injectIdInto` have been superseded by usage of `DBEntity` id getter/setter
just use the converter method to pojo as it is now meant to include entity relationships (see `657da582`)
avoids possible inaccuracy when using `Predicate` to match a record if the affected records amount to more than one, do not update to keep data safe and consistent
this now resides in the converter service because currently it has a method that is called both for Creation and Update operations
follow similar guidelines to those of the `ProductCategory` services products' relationships to images are still only tied after said product is beforehand persisted into the database
This reverts commit 2f29de2.
Kudos, SonarCloud Quality Gate passed! |
4 tasks
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.
PR Checklist
mvn test
returns exit code 0, without errors)PR Type
Summary
Resolve issue #232
Gives this backend the ability to perform partial and full updates, using the analogues REST API methods, PATCH and PUT, respectively.
To successfully enable such a feature, a good measure of refactoring had to be done. These changes are more thoroughly explained in the
CHANGELOG.md
file.At the center of everything, method signatures from the
CrudService
andPatchService
interfaces were altered.