Open rmckinnon opened 6 years ago
I just created a test case for the described scenario: https://github.com/derjust/spring-data-dynamodb/pull/208/files#diff-dcdb5f59762ba17e758ce60997071885R196
If I understand correctly, the given situation is that id
is the Hash key and childId
is the Range key.
As with the entity model itself, DynamoDB's structure and the way spring-data expects doesn't perfectly align:
The deleteById
(Id as the conceptual thing represented by two fields on the DynamoDB side but as a distinct entity class on the spring-data side) on the repository must be used - as per the referenced example.
Otherwise the childId
is considered a regular attribute - which is not the case as it marked as part of the (conceptual) id
Expected Behavior
When calling the repository.deleteByIdAndSomeAttribute doesn't work when the SomeAttribute is the primary sort key.
Actual Behavior
A org.socialsignin.spring.data.dynamodb.exception.BatchDeleteException is thrown with the following stacktrace:
Steps to Reproduce the Problem
Excerpt:
Specifications