How to build dynamic queries with Spring Data Redis Repositories?

落爺英雄遲暮 提交于 2019-12-04 15:51:23

Right now, there's no support to create dynamic queries. It sounds a bit as if Query by Example could be the thing you're looking for. Spring Data MongoDB and Spring Data JPA already implement Query by Example.

A query is created by the data store module to match an example domain object:

Person person = new Person();                         
person.setFirstname("Dave");                          

Example<Person> example = Example.of(person); 

MongoRepository repo = …
List<Person> result = repo.findAll(example); // returns all objects that with Dave in firstname

Query by Example is not supported by Spring Data Redis right now but it should be possible to provide basic support.

I created a ticket DATAREDIS-605 to track the progress of this feature.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!