Hi I have exposed a custom @RepositoryRestController to expose a custom method via Spring data rest the code for the method looks something like below
@RequestMapping(method = RequestMethod.GET, value = "/foo/rsqlsearch")
public @ResponseBody PagedResources<Resource<Foos>> findAllPaged(@RequestParam(value = "rsql") String rsql, Pageable pageable) {
Page<Foo> foos= fundRepository.searchByRsql(rsql, pageable);
return pagedResourcesAssembler.toResource(foos);
}
foo entity
@Entity
@Table(name = "FOO_TBL", schema = "F")
@Data
public class Foo implements Identifiable<String> {
@Id
@Column(name = "ID")
@Description("Id")
private String id;
// associations
@OneToMany(mappedBy = "foo", fetch = FetchType.LAZY)
private List<FooFriends> fooFriends;
@OneToMany(mappedBy = "foo", fetch = FetchType.LAZY)
private List<Marks> marks;
}
The Foo entity renders fine with the data coming out of the custom repository method .But the json representation does not include the links to the associations for the entity .Is there a way by which these associations can be exposed via the framework without writing custom ResourceProcessor like they do in other out of the box representations of spring data rest .