-
Aug 13th, 2012, 09:43 PM
#1
Spring Data Rest-search with id not existed in db
Hi I'm using Spring-data-rest
Created Person entity and PersonRepository
public interface PersonRepository extends CrudRepository<Person, Long> {
@RestResource(path = "id")
public List<Person> findById(@Param("id") Long id);
}
From the above code, if I search with id number that is not existed in the database, returns Json code like:
{ "results" : [ ], "totalCount" : 0, "totalPages" : 1, "currentPage" : 1, "_links" : [ ] }
It should be better if it returns an exception like 204 or no values in db.
Please suggest..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules