实体模型继承Spring Hateoas 1.0

问题描述 投票:0回答:1

对于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

您知道这里出什么事了吗?

spring-hateoas
1个回答
0
投票

这似乎是Spring Hateoas中的错误,请参阅Generics bounds too strict in RepresentationModelAssemblerSupport。该修复程序将在1.1.0中发布。对Spring Hateaos团队表示敬意!

谢谢

© www.soinside.com 2019 - 2024. All rights reserved.