-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
type: enhancementA general enhancementA general enhancement
Milestone
Description
Since 2014, core Spring Data JPA has supported deleteBy/removeBy in queries, just like findBy queries. However, Spring Data Redis does not support this, instead throwing
java.lang.UnsupportedOperationException: Query method not supported.
at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.doExecute(KeyValuePartTreeQuery.java:144)
at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.execute(KeyValuePartTreeQuery.java:110)
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137)
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121)
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:159)
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:138)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at com.sun.proxy.$Proxy115.deleteByRecordingSid(Unknown Source)
I would like to request that deleteBy (and its synonym removeBy) be supported in queries.
Code Example
@RedisHash("Student")
public class Student {
@Id
private String id;
@Indexed
private String name;
// Getters and setters
}@Repository
public interface StudentRepository extends CrudRepository<Student, String> {
Student findByName(String name);
void deleteByName(String name);
}studentRepository.findByName("John Doe"); // Successful
studentRepository.deleteByName("John Doe"); // UnsupportedOperationExceptionelvisnap, lucapiccinelli, erendogan51, 0xcra5hs, hyeongguen-song and 1 more
Metadata
Metadata
Assignees
Labels
type: enhancementA general enhancementA general enhancement