Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/202.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 安卓AWS DynamoDB“;“无哈希键条件”;_Android_Amazon Web Services_Amazon Dynamodb - Fatal编程技术网

Android 安卓AWS DynamoDB“;“无哈希键条件”;

Android 安卓AWS DynamoDB“;“无哈希键条件”;,android,amazon-web-services,amazon-dynamodb,Android,Amazon Web Services,Amazon Dynamodb,我有一个DynamoDB表格,里面有一些数据。有一个hashkey为“class_id”,一个rangekey为“message_timestamp” 在我的android代码中,我试图查询比上次收到的消息更新的消息 int lastMessageTimestamp = GetNewestTimestamp(); DynamoChatData messagesToFind = new DynamoChatData(); Log.i(TAG,String.valueOf(class_id));

我有一个DynamoDB表格,里面有一些数据。有一个hashkey为“class_id”,一个rangekey为“message_timestamp”

在我的android代码中,我试图查询比上次收到的消息更新的消息

int lastMessageTimestamp = GetNewestTimestamp();

DynamoChatData messagesToFind = new DynamoChatData();
Log.i(TAG,String.valueOf(class_id));
messagesToFind.SetClassId(class_id); // Set to 2 in the debugger at runtime

Condition rangeKeyCondition = new Condition();
rangeKeyCondition.withComparisonOperator(ComparisonOperator.GT.toString());

AttributeValue attributeValue = new AttributeValue();
attributeValue.withN(String.valueOf(lastMessageTimestamp));

rangeKeyCondition.withAttributeValueList(attributeValue);

DynamoDBQueryExpression<DynamoChatData> query = new DynamoDBQueryExpression<>();
query.withHashKeyValues(messagesToFind);
query.withRangeKeyCondition("message_timestamp", rangeKeyCondition);
query.withConsistentRead(false);

PaginatedQueryList result = objectMapper.query(DynamoChatData.class, query);
我遵循概述的基本示例,并在该网站上阅读了大量帖子。我不知道为什么我会被解雇

java.lang.IllegalArgumentException: Illegal query expression: No hash key condition is found in the query
错误


任何洞察都是值得赞赏的。

尝试使用重构您的getter/setter名称,以便它们像标准Java约定一样以小写字母开头。我相信mapper会把getter看作是以“get”开头的方法,我认为它缺少了你的方法,因为它们是以capitolg开头的

让我知道这是否解决了你的问题!
韦斯顿

谢谢你的建议。我试图更改函数的大小写。我也犯了同样的错误。调试器仍然表示该值设置正确。
java.lang.IllegalArgumentException: Illegal query expression: No hash key condition is found in the query