java - Spring Data REST: How to retrieve many items using list of Ids in one single call? -
i can retrieve 1 single book spring data rest call such as: /book/{id}
now, if know ids of 2 books , want retrieve them @ once? should call be? tried following returning me different books specified ones:
get /book?ids=id1,id2
you declare query method in repository interface this:
list<book> findbyidin(@param("ids") long[] ids);
so can request books way:
get /book/search/findbyidin?ids=1,6,9
Comments
Post a Comment