0

使用 Spring Hateoas 0.25,我们有这样的代码:

public class StatisticsResource extends Resource<StatisticsDto>
{
    :
}

public class StatisticsResourceAssembler
        extends ResourceAssemblerSupport<StatisticsDto, StatisticsResource>
{
    :
}

现在我将其迁移到 1.0,如下所示:

public class StatisticsResource extends EntityModel<StatisticsDto>
{
    :
}

public class StatisticsResourceAssembler
        extends RepresentationModelAssemblerSupport<StatisticsDto, StatisticsResource>
{
    :
}

然而,这不会编译:

extends RepresentationModelAssemblerSupport<StatisticsDto, StatisticsResource>
                                                           ^
where D is a type-variable:
    D extends RepresentationModel<D> declared in class RepresentationModelAssemblerSupport

知道这里出了什么问题吗?

4

1 回答 1

0

这似乎是 Spring Hateoas 中的一个错误,请参阅Generics bounds too strict in RepresentationModelAssemblerSupport。该修复程序将在 1.1.0 中发布。向 Spring Hateos 团队致敬!

谢谢

于 2019-11-22T11:18:19.940 回答