Does Spring Data Key Value support derived delete query methods? It doesn't work for me.
I extended Repository
, declared a few CrudRepository
methods, and added these derived query methods to it:
List<ChatMessageEntity> findByChatIdOrderBySequenceNumberAsc(String chatId);
List<ChatMessageEntity> removeByChatId(String chatId);
Long deleteByChatId(String chatId);
All the unit tests pass except for the 2 derived delete query methods. removeByChatId
returns the expected list, but does not delete anything. deleteByChatId
throws this UnsupportedOperationException
:
java.lang.UnsupportedOperationException: Query method not supported.
at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.execute(KeyValuePartTreeQuery.java:97)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:462)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:440)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at com.sun.proxy.$Proxy29.deleteByChatId(Unknown Source)
at com.pgi.kcondon.axonminexp.service.ChatRepositoryTest.testRemoveByChatId(ChatRepositoryTest.java:159)
I'm using Spring Boot 1.3.3.RELEASE, which depends on Spring Data Key Value 1.0.4.RELEASE.