Код: Выделить всё
interface PersonRepositoryCustom {
List
findByFistName(String name);
}
class PersonRepositoryImpl implements PersonRepositoryCustom, InitializingBean {
@Override
public void afterPropertiesSet() throws Exception {
// initialization here
}
@Override
public List findByFistName(String name) {
// find the list of persons with the given firstname
}
}
@RepositoryRestResource(collectionResourceRel = "people", path = "people")
public interface PersonRepository extends PagingAndSortingRepository {
List findByLastName(@Param("name") String name);
}
Код: Выделить всё
{
"_links" : {
"findByLastName" : {
"href" : "http://localhost:8080/people/search/findByLastName{?name}",
"templated" : true
}
}
}
Кроме того, есть ли способ динамически/программно добавлять репозитории, которые будут доступны через REST?
Подробнее здесь: https://stackoverflow.com/questions/252 ... em-through