spring data rest

post对应insert
put对应update
get对应select
delete对应delete

@RepositoryRestResource(path = "people")
public interface PersonRepository extends JpaRepository<Person, Long> {

	@RestResource(path = "nameStartsWith", rel = "nameStartsWith")
	Person findByNameStartsWith(@Param("name") String name);

}


RepositoryRestResource设置实体对应路径
@RestResource设置方法对应路径

猜你喜欢

转载自xl822786603.iteye.com/blog/2337084