Controller throwing error after adding hateoas support in a webflux app

Viewed 379

When adding RepresentationModel to my entity, I am receiving an error whilst getting data from the db. I can post with no problem.

@Document(collection = "airports")
public class Airport extends RepresentationModel<Airport> {

  @Id
  private String icao;

}

and the controller

@GetMapping
public Flux<Airport> getAirports() {
  return repository.findAll();
}

And I get the following error:

java.lang.IllegalStateException: Cannot set property links because no setter, no wither and it's not part of the persistence constructor public com.example.mongo.entities.Airport()!

I thought that maybe it could have been a problem with lombok, and implemented the constructors, getters and setters manually, but to no avail!

0 Answers
Related