小编Din*_*nan的帖子

AWS DynamoDBMapper 保存方法不断抛出“DynamoDBMappingException:不支持;需要 @DynamoDBTyped 或 @DynamoDBTypeConverted`

我遵循了此处概述的所有内容 - 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)

这是我的存储库界面 …

java spring-data-jpa amazon-dynamodb spring-boot

5
推荐指数
1
解决办法
7626
查看次数