We have a usage case where a user can pass in arbitrary search criteria for a single archive, and endorse production Using Spring Data Treasures, it is very simple if we know ahead of time that they are searching by simple expansion MongoRepository, and can declare:
However, if we use either the fluent interface ourselves or build a Mongo string and wrap it in the code, then findfuendbase (type foo, type bar, Type False, pageable page)> Basic equation class, I can not find a way to get it in a repository instance. Not: The functionality which is able to see me. And I can not see that I hope I do not have to do my paging role (to leave Calculate and limit parameters, which I think is not that difficult) and call directly on the template, but I think that if this be the best option. I do not think this can be done the way I hope, but I Come up with an alternative solution. As a backdrop, we have access to data in DAO, and some representatives of the repository, put all our methods in order to do something in the template. Actually, this ( Pages & Lt; Thing & gt;
Page & lt; Thing & gt;
MongoTemplate functionality inquiry with page separation
MongoTemplate # count (query, class)
with query # (pageable)
Turn on the page content with MongoTemplate # find (query, page)
Get the list
was used for that query and returned
count by counter-call run, and on the caller To return, create a new
PageImp .
DocDbDomain document is a test domain for testing DB stuff Class):
No comments:
Post a Comment