I have a JPA tree structure
@Entity public class Document { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; private String text; @ManyToOne @JoinColumn(name = "parent") Document parent; @OneToMany(mappedBy = "parent", fetch = FetchType.EAGER) Set<Document> children; (getters and setters) }
and projections
@Projection(name = "all", types = Document.class) public interface AllDocumentsProjection { int getId(); String getText(); Set<Document> getChildren(); }
When I make a GET request with a url
local: 8080 / documents / 1 projection = all
I get only the first children of the root document. Not children of children. Is this possible with forecasts? Or is there another way?
spring-data-rest hateoas jpa tree projection
Nordkraft
source share