Skip to content
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

Annotation @Query does not support Non-String Type #526

Open
qqyycom opened this issue Feb 24, 2022 · 0 comments
Open

Annotation @Query does not support Non-String Type #526

qqyycom opened this issue Feb 24, 2022 · 0 comments

Comments

@qqyycom
Copy link

qqyycom commented Feb 24, 2022

@query(filterExpression = "#field = :value", consistentReads = QueryConstants.ConsistentReadMode.EVENTUAL,
expressionMappingNames = {@ExpressionAttribute(key = "#field", value = "key")},
expressionMappingValues = {@ExpressionAttribute(key = ":value", parameterName = "key")})
List findByUidAndDeviceId(@param("uid") String uid, @param("device_id") String deviceId, @param("key") Integer key);

Expected Behavior

I want QueryFilter with Number type, But It doesn't support

Actual Behavior

Throws ClassCastException

which happens in {@DynamoDBEntityWithHashAndRangeKeyCriteria} line 216

queryExpression.addExpressionAttributeValuesEntry(value.key(), new AttributeValue(mappedExpressionValues.get(value.parameterName())));

the AttributeValue constructor only support String type value

Steps to Reproduce the Problem

Specifications

  • Spring Data DynamoDB Version: 5.2.5
  • Spring Data Version: 2.5.2
  • AWS SDK Version:
  • Java Version: 8
  • Platform Details:

All those information are logged by org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBRepositoryFactory on INFO level on startup.
Or use java -version and mvn dependency:tree | grep -E 'spring|aws' to provide those version numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant