-
Notifications
You must be signed in to change notification settings - Fork 139
Fix NPE when deleting nonexistent entity. #175
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
Conversation
codecov-io
commented
Jul 3, 2018
Codecov Report
@@ Coverage Diff @@ ## master #175 +/- ## ============================================ - Coverage 63.65% 63.61% -0.04% Complexity 562 562 ============================================ Files 72 72 Lines 1978 1979 +1 Branches 374 375 +1 ============================================ Hits 1259 1259 - Misses 574 575 +1 Partials 145 145
Continue to review full report at Codecov.
|
Thanks for your PR!
I just tested with the provided test case (big thanks!) but got the expected EmptyResultDataAccessException do you encounter a NullPointerException?
Which version of spring-data-dynamodb do you use?
Hi, @derjust
So, provided by default in CrudRepository#deleteById(ID) will throw EmptyResultDataAccessException.
But if you create a custom delete method like MyRepo#deleteBySomethingEquals(String) if no entity satisfies given condition, Null pointer exception is raised.
Another observation: the delete executor in current form will always delete single record even if query params will return more than one. Should I change query.getSingleResult() to query,getResultList() and then run bulk delete if result list is not empty?
No description provided.