0

I try to compile an existing spring boot (2.7.1) application with spring-native (0.12.1), and i'm kind of stuck on an issue related to spring data rest projection (based on interface).

For example, the Entity is like the following :

public class Place {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    protected UUID id;

    @Column
    private String name;

    @Column
    private String address;

    @Column
    private String city;
}

And the projection is


@Projection(name = "displayPlace",types = Place.class)
public interface DisplayPlace{

    String getName();

    String getAddress();

    String getCity();

    @Value("#{@placeService.tellIfCanBeDeleted(target)}")
    DeletionStatus getDeletionStatus();
}

When compiled without spring-native, I can use the projection to query my sprig-data-rest repository, and everything is fine

The rest api looks like :


{
  "_links": {
    "places": {
      "href": "https://host/api/places{?page,size,sort,projection}",
      "templated": true
    }
  }
}

But when I compile using spring-native, the rest api doesnt refers the projection in the URI :

{
  "_links": {
    "places": {
      "href": "http://host/api/places{?page,size,sort}",
      "templated": true
    }
  }
}

And, of course, I can't use the projection.

I'm pretty convinced I have to write a @TypeHint for the DisplayPlace Interface, but I struggle with it...

Anyone has an idea please ?

0 Answers0