Where is Spring ResourceSupport
Asked Answered
P

1

6

I'm reading Spring in Action 5th. and to add hateoas hyperlink. this class is extending org.springframework.hateoas.ResourceSupport however I cannot find it. i'm using Spring Boot version 2.2.5.RELEASE

import org.springframework.hateoas.ResourceSupport;
import tacos.Taco;

@Relation(value = "taco", collectionRelation = "tacos")
public class TacoResource extends ResourceSupport {

    private static final IngredientResourceAssembler ingredientAssembler = new IngredientResourceAssembler();

    @Getter
    private final String name;

So what's the name of this class in this version since the source code was using an older versio I think 2.0.2 M1

Proceleusmatic answered 19/3, 2020 at 17:38 Comment(0)
R
14

Below is from the Spring HATEOAS documentation

The ResourceSupport/Resource/Resources/PagedResources group of classes never really felt appropriately named. After all, these types do not actually manifest resources but rather representation models that can be enriched with hypermedia information and affordances. Here’s how new names map to the old ones:

ResourceSupport is now RepresentationModel

Resource is now EntityModel

Resources is now CollectionModel

PagedResources is now PagedModel

So since Spring HATEOAS 1.0, ResourceSupport is RepresentationModel

Spring also has provided a migration script which can help in replacing the legacy Spring HATEOAS type references with the new ones.

Romeo answered 19/3, 2020 at 17:59 Comment(2)
Buddy you're a life saver. they should be more people like you in stackoverflow. Thanks & stay safe.Proceleusmatic
I hit enter and new cmd window open and closes but nothing changesProceleusmatic

© 2022 - 2024 — McMap. All rights reserved.