As the name says.
Basically I would like to make queries like
/api/todos/?completed=eq.true&created_at=lt.1486462109399
Are there any ready-made spring way
to achieve this? Something similar to the page / page mechanism would be great.
If not, I think I could implement it using the Hibernate Criteria Queries and Argument Re-solvers. Basically allows me to write my controllers, for example
@GetMapping public ResponseEntity<Page<TodoDTO>> listAll(Criteria criteria, Pageable pageable) { Page<Todo> todos = todoService.listAll(criteria, pageable) ... }
The Argument custom argument is responsible for turning the query string into criteria. Not quite sure how I would handle this in the service, but in the direction in which I would try to implement this.
Would this be a good approach? Any recommendations? (Everyone suggests that there is no ready-made mechanism for this).
Your help is greatly appreciated.
Dawid source share