我遵循了此处概述的所有内容 - https://github.com/derjust/spring-data-dynamodb/wiki/Use-Hash-Range-keys。但仍然没有运气。
我有一个带有哈希键和排序键的 DynamoDB 表。
这是我的实体类RecentlyPlayed.class
@DynamoDBTable(tableName="some-table")
public class RecentlyPlayed {
@Id
private RecentlyPlayedId recentlyPlayedId;
// ----- Constructor methods -----
@DynamoDBHashKey(attributeName="keyA")
// Getter and setter
@DynamoDBRangeKey(attributeName="keyB")
// Getter and setter
}
Run Code Online (Sandbox Code Playgroud)
这是我的重点课程RecentlyPlayedId.class
public class RecentlyPlayedId implements Serializable {
private static final long serialVersionUID = 1L;
private String keyA;
private String keyB;
public RecentlyPlayedId(String keyA, String keyB) {
this.keyA = keyA;
this.keyB = keyB;
}
@DynamoDBHashKey
// Getter and setter
@DynamoDBRangeKey
// Getter and setter
}
Run Code Online (Sandbox Code Playgroud)
这是我的存储库界面 …