2

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.

3
  • 1
    I've created DATAKV-135 to add support for this to the key-value module. Commented May 4, 2016 at 5:45
  • Thanks @ChristophStrobl. Key Value has been very helpful for building out a new system without having to deal with, or commit to, a specific distributed repository platform. Commented May 4, 2016 at 13:53
  • Just wanted to add my support for DATAKV-135, it would be very useful to have. Commented Mar 25, 2019 at 6:42

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.