com.amazonaws.services.dynamodbv2.datamodeling.dynamodbmappingexception:无法示例化类

soat7uwm  于 2021-07-09  发布在  Java
关注(0)|答案(0)|浏览(302)

我能救一个孩子 Asset 对象,但加载时,我总是 com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMappingException: could not instantiate class Asset ,下面是我当前的实现。

private DynamoDBMapper mapper;

    public void saveAsset(Asset asset) {
        mapper.save(mediaAsset);  // OK
    }

    public Asset getAsset(int id) {
        return mapper.load(Asset.class, id);  // DynamoDBMappingException
    }

    @Data
    @AllArgsConstructor
    @DynamoDBTable(tableName = "asset")
    public static class Asset {

        @DynamoDBHashKey(attributeName="Id")
        private Integer id;

        @DynamoDBAttribute(attributeName="Mz")
        private Mz mz;

    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @DynamoDBDocument
    public static class Mz {
        @DynamoDBAttribute(attributeName = "Codec")
        private String codec;
    }

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题