I would like to expose new endpoints for my repository which also extends RevisionRepository.
@RepositoryRestResource(collectionResourceRel = "persons", itemResourceRel = "person", path = "persons")
public interface PersonRepository extends PagingAndSortingRepository<PersonEntity, Long>, RevisionRepository<PersonEntity, Long, Integer> {
Revision<Integer, PersonEntity> findLastChangeRevision(@Param("id") Long id);
Revisions<Integer, PersonEntity> findRevisions(@Param("id") Long id);
Page<Revision<Integer, PersonEntity>> findRevisions(@Param("id") Long id, Pageable pageable);
PersonEntity findByName(@Param("name") String name);
}
My issue right now, is that these new methods are not exposed as urls (findLastChangeRevision
, findRevisions
) and only findByName
is under the search url. I am currently not very particular with regards to the actual url form, as long as it works.
The only option I know right now is to
- Separate the revision repositories
- Create a new controller that maps to "/", to replace the one created by Spring Data Rest, and add all the repository links manually. One of my issues here is that my links will be hardcoded (unlike when linking to Controllers), and the paths will be relative-- not necessarily bad, but will make everything inconsistent.
- Add links to "/" that maps to the revision repositories
I have a lot of reservations with my option above. I am not sure how to proceed.