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
[v5.0.1 Regression] Query Creation Uses Attribute Name instead of Column Name #118
Comments
Interesting approach. Just to be clear here: You say it was working with Your analysis makes a lot of sense - it's just that I do not recall to change anything with that regard from 4.5 -> 5.0. Nevertheless want to fix it. |
Correct, this is a regression between |
Also the bug doesn't appear to be related to our rather odd column names with pipe characters, but rather whenever the column name differs from the field name. This will also trigger the bug: @DynamoDBHashKey(attributeName = "theHashKey")
public String getCustomerDocumentKey() {
...
} |
Highly appreciate the PR with the two branches!
Will have a look tonight
|
Transfered the testcase into its own PR: #123 @pluttrell May you provide a |
@derjust I'm not sure what's different about how we're running it, but here's what I see when I run both branches of my example project: https://gist.github.com/pluttrell/4f263ace8053eb3038fd96e4e436aa67. |
@derjust And here's the dependency tree for both branches: https://gist.github.com/pluttrell/0117793ed15c698b58077f90b3d97517. Not sure what specific versions your looking for, but hope this helps. |
I also just tested with the version of the aws sdk that shipped yesterday with both branches and they both exhibit the same problem.
|
Issue #118: Query Creation Uses Attribute Name instead of Column Name
Still unsure why it worked in the first place - classic I guess 🤣 |
Many thanks for the fix. Wondering if you have a target timeframe for 5.0.2? I'm not trying to push or anything, just curious. |
I'd love to get all the issues marked as 'bug' solved with |
Sure thing. I really wasn’t trying to push, just to see if there was a timeframe so we can plan accordingly. And in looking at the bugs, it doesn’t look like it’ll be too long, so I think we can wait. |
I'm migrating a Spring Boot 1.5.9 project to Spring Boot 2.0 and thus have upgraded to
com.github.derjust:spring-data-dynamodb:5.0.1
. This project contains several tables that use contrived keys and we map them like this:In case you're wondering why we have contrived keys like this, it has to do with DynamoDB's limit to two keys per table.. And we have a separate column for the Range key. I just omitted it for brevity.
In our
CrudRepository
we have a query method such as this (among others):Notice how we've defined the entity property
customerDocumentKey
to map the column namecustomerId|documentType
.The store operation works perfectly, but when we lookup records using
findByCustomerDocumentKey
we get this error:In looking at this in the debugger, this line of code
org.socialsignin.spring.data.dynamodb.repository.query.AbstractDynamoDBQueryCriteria.getPropertyAttributeValue(..)
on line 501 is calling the AWS SDK'sDynamoDBMapperTableModel::field
but sending in the attribute name, which in this case iscustomerDocumentKey
and the AWS SDK only knows about the actual column names, which in this case iscustomerId|documentType
. I've confirmed that the actual column name exists in the fields Map withinDynamoDBMapperTableModel
.The text was updated successfully, but these errors were encountered: