java.lang.IllegalArgumentException: IN (1): [IsIn, In]is not supported for redis query derivation - Redis










0















It looks like Spring Data Redis does not support the IsIn, In queries yet. I am not sure if there is any other of way of doing it as its very basic queries. It was either to be happned using Spring Data Redis or RestTemplate.



java.lang.IllegalArgumentException: IN (1): [IsIn, In]is not supported for redis query derivation
at org.springframework.data.redis.repository.query.RedisQueryCreator.from(RedisQueryCreator.java:67)
at org.springframework.data.redis.repository.query.RedisQueryCreator.create(RedisQueryCreator.java:53)
at org.springframework.data.redis.repository.query.RedisQueryCreator.create(RedisQueryCreator.java:41)
at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:119)
at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:95)
at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:81)
at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.createQuery(KeyValuePartTreeQuery.java:211)
at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.prepareQuery(KeyValuePartTreeQuery.java:148)
at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.execute(KeyValuePartTreeQuery.java:106)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:602)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:590)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy76.findByNameIn(Unknown Source)
at com.mastercard.customer.program.UserGroupTest.test(UserGroupTest.java:58)


Group.java



@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@RedisHash("groups")
public class Group
@Id
private Long groupId;
private String name;



User.java



@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@RedisHash("users")
public class User
@Id
private Long userId;
private String name;



UserGroupTest.java



@Log4j
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class UserGroupTest extends RepositoryTestSupport
@Autowired UserRepository userRepository;
@Autowired GroupRepository groupRepository;

@Before
public void setUp()
User user1 = User.builder().userId(1L).name("John").build();
User user2 = User.builder().userId(2L).name("Sally").build();
User user3 = User.builder().userId(3L).name("Chris").build();

Group group1 = Group.builder().groupId(1L).name("Nature-Group").build();
Group group2 = Group.builder().groupId(2L).name("Music-Group").build();
Group group3 = Group.builder().groupId(3L).name("Sports-Group").build();

userRepository.save(user1);
userRepository.save(user2);
userRepository.save(user3);

groupRepository.save(group1);
groupRepository.save(group2);
groupRepository.save(group3);


@Test
public void test()
List<User> users = userRepository.findByNameIn(Arrays.asList("John", "Sally"));
System.out.println(users.size());











share|improve this question




























    0















    It looks like Spring Data Redis does not support the IsIn, In queries yet. I am not sure if there is any other of way of doing it as its very basic queries. It was either to be happned using Spring Data Redis or RestTemplate.



    java.lang.IllegalArgumentException: IN (1): [IsIn, In]is not supported for redis query derivation
    at org.springframework.data.redis.repository.query.RedisQueryCreator.from(RedisQueryCreator.java:67)
    at org.springframework.data.redis.repository.query.RedisQueryCreator.create(RedisQueryCreator.java:53)
    at org.springframework.data.redis.repository.query.RedisQueryCreator.create(RedisQueryCreator.java:41)
    at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:119)
    at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:95)
    at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:81)
    at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.createQuery(KeyValuePartTreeQuery.java:211)
    at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.prepareQuery(KeyValuePartTreeQuery.java:148)
    at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.execute(KeyValuePartTreeQuery.java:106)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:602)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:590)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
    at com.sun.proxy.$Proxy76.findByNameIn(Unknown Source)
    at com.mastercard.customer.program.UserGroupTest.test(UserGroupTest.java:58)


    Group.java



    @Builder
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @RedisHash("groups")
    public class Group
    @Id
    private Long groupId;
    private String name;



    User.java



    @Builder
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @RedisHash("users")
    public class User
    @Id
    private Long userId;
    private String name;



    UserGroupTest.java



    @Log4j
    @RunWith(SpringJUnit4ClassRunner.class)
    @SpringBootTest
    public class UserGroupTest extends RepositoryTestSupport
    @Autowired UserRepository userRepository;
    @Autowired GroupRepository groupRepository;

    @Before
    public void setUp()
    User user1 = User.builder().userId(1L).name("John").build();
    User user2 = User.builder().userId(2L).name("Sally").build();
    User user3 = User.builder().userId(3L).name("Chris").build();

    Group group1 = Group.builder().groupId(1L).name("Nature-Group").build();
    Group group2 = Group.builder().groupId(2L).name("Music-Group").build();
    Group group3 = Group.builder().groupId(3L).name("Sports-Group").build();

    userRepository.save(user1);
    userRepository.save(user2);
    userRepository.save(user3);

    groupRepository.save(group1);
    groupRepository.save(group2);
    groupRepository.save(group3);


    @Test
    public void test()
    List<User> users = userRepository.findByNameIn(Arrays.asList("John", "Sally"));
    System.out.println(users.size());











    share|improve this question


























      0












      0








      0


      1






      It looks like Spring Data Redis does not support the IsIn, In queries yet. I am not sure if there is any other of way of doing it as its very basic queries. It was either to be happned using Spring Data Redis or RestTemplate.



      java.lang.IllegalArgumentException: IN (1): [IsIn, In]is not supported for redis query derivation
      at org.springframework.data.redis.repository.query.RedisQueryCreator.from(RedisQueryCreator.java:67)
      at org.springframework.data.redis.repository.query.RedisQueryCreator.create(RedisQueryCreator.java:53)
      at org.springframework.data.redis.repository.query.RedisQueryCreator.create(RedisQueryCreator.java:41)
      at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:119)
      at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:95)
      at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:81)
      at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.createQuery(KeyValuePartTreeQuery.java:211)
      at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.prepareQuery(KeyValuePartTreeQuery.java:148)
      at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.execute(KeyValuePartTreeQuery.java:106)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:602)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:590)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      at com.sun.proxy.$Proxy76.findByNameIn(Unknown Source)
      at com.mastercard.customer.program.UserGroupTest.test(UserGroupTest.java:58)


      Group.java



      @Builder
      @Data
      @AllArgsConstructor
      @NoArgsConstructor
      @RedisHash("groups")
      public class Group
      @Id
      private Long groupId;
      private String name;



      User.java



      @Builder
      @Data
      @AllArgsConstructor
      @NoArgsConstructor
      @RedisHash("users")
      public class User
      @Id
      private Long userId;
      private String name;



      UserGroupTest.java



      @Log4j
      @RunWith(SpringJUnit4ClassRunner.class)
      @SpringBootTest
      public class UserGroupTest extends RepositoryTestSupport
      @Autowired UserRepository userRepository;
      @Autowired GroupRepository groupRepository;

      @Before
      public void setUp()
      User user1 = User.builder().userId(1L).name("John").build();
      User user2 = User.builder().userId(2L).name("Sally").build();
      User user3 = User.builder().userId(3L).name("Chris").build();

      Group group1 = Group.builder().groupId(1L).name("Nature-Group").build();
      Group group2 = Group.builder().groupId(2L).name("Music-Group").build();
      Group group3 = Group.builder().groupId(3L).name("Sports-Group").build();

      userRepository.save(user1);
      userRepository.save(user2);
      userRepository.save(user3);

      groupRepository.save(group1);
      groupRepository.save(group2);
      groupRepository.save(group3);


      @Test
      public void test()
      List<User> users = userRepository.findByNameIn(Arrays.asList("John", "Sally"));
      System.out.println(users.size());











      share|improve this question
















      It looks like Spring Data Redis does not support the IsIn, In queries yet. I am not sure if there is any other of way of doing it as its very basic queries. It was either to be happned using Spring Data Redis or RestTemplate.



      java.lang.IllegalArgumentException: IN (1): [IsIn, In]is not supported for redis query derivation
      at org.springframework.data.redis.repository.query.RedisQueryCreator.from(RedisQueryCreator.java:67)
      at org.springframework.data.redis.repository.query.RedisQueryCreator.create(RedisQueryCreator.java:53)
      at org.springframework.data.redis.repository.query.RedisQueryCreator.create(RedisQueryCreator.java:41)
      at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:119)
      at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:95)
      at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:81)
      at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.createQuery(KeyValuePartTreeQuery.java:211)
      at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.prepareQuery(KeyValuePartTreeQuery.java:148)
      at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.execute(KeyValuePartTreeQuery.java:106)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:602)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:590)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      at com.sun.proxy.$Proxy76.findByNameIn(Unknown Source)
      at com.mastercard.customer.program.UserGroupTest.test(UserGroupTest.java:58)


      Group.java



      @Builder
      @Data
      @AllArgsConstructor
      @NoArgsConstructor
      @RedisHash("groups")
      public class Group
      @Id
      private Long groupId;
      private String name;



      User.java



      @Builder
      @Data
      @AllArgsConstructor
      @NoArgsConstructor
      @RedisHash("users")
      public class User
      @Id
      private Long userId;
      private String name;



      UserGroupTest.java



      @Log4j
      @RunWith(SpringJUnit4ClassRunner.class)
      @SpringBootTest
      public class UserGroupTest extends RepositoryTestSupport
      @Autowired UserRepository userRepository;
      @Autowired GroupRepository groupRepository;

      @Before
      public void setUp()
      User user1 = User.builder().userId(1L).name("John").build();
      User user2 = User.builder().userId(2L).name("Sally").build();
      User user3 = User.builder().userId(3L).name("Chris").build();

      Group group1 = Group.builder().groupId(1L).name("Nature-Group").build();
      Group group2 = Group.builder().groupId(2L).name("Music-Group").build();
      Group group3 = Group.builder().groupId(3L).name("Sports-Group").build();

      userRepository.save(user1);
      userRepository.save(user2);
      userRepository.save(user3);

      groupRepository.save(group1);
      groupRepository.save(group2);
      groupRepository.save(group3);


      @Test
      public void test()
      List<User> users = userRepository.findByNameIn(Arrays.asList("John", "Sally"));
      System.out.println(users.size());








      spring spring-boot redis jedis spring-data-redis






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 '18 at 15:06







      PAA

















      asked Nov 12 '18 at 14:55









      PAAPAA

      2,53222036




      2,53222036






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Spring Data Redis 2.1.2 (recent version at the time of writing) does not support In queries through query derivation. There is a ticket to support the In query type.






          share|improve this answer























          • Example uses internally or-queries (the same that applies for In) but it queries against a single value and not an array since Example uses the actual domain type as query input type.

            – mp911de
            Nov 12 '18 at 15:18






          • 1





            Spring Data Redis reference docs explain what's working and what is not working. Queries are case-sensitive because all data in Redis is just bytes. Changing lettercasing results in a different binary representation.

            – mp911de
            Nov 12 '18 at 15:39










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53264718%2fjava-lang-illegalargumentexception-in-1-isin-inis-not-supported-for-redis%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Spring Data Redis 2.1.2 (recent version at the time of writing) does not support In queries through query derivation. There is a ticket to support the In query type.






          share|improve this answer























          • Example uses internally or-queries (the same that applies for In) but it queries against a single value and not an array since Example uses the actual domain type as query input type.

            – mp911de
            Nov 12 '18 at 15:18






          • 1





            Spring Data Redis reference docs explain what's working and what is not working. Queries are case-sensitive because all data in Redis is just bytes. Changing lettercasing results in a different binary representation.

            – mp911de
            Nov 12 '18 at 15:39















          0














          Spring Data Redis 2.1.2 (recent version at the time of writing) does not support In queries through query derivation. There is a ticket to support the In query type.






          share|improve this answer























          • Example uses internally or-queries (the same that applies for In) but it queries against a single value and not an array since Example uses the actual domain type as query input type.

            – mp911de
            Nov 12 '18 at 15:18






          • 1





            Spring Data Redis reference docs explain what's working and what is not working. Queries are case-sensitive because all data in Redis is just bytes. Changing lettercasing results in a different binary representation.

            – mp911de
            Nov 12 '18 at 15:39













          0












          0








          0







          Spring Data Redis 2.1.2 (recent version at the time of writing) does not support In queries through query derivation. There is a ticket to support the In query type.






          share|improve this answer













          Spring Data Redis 2.1.2 (recent version at the time of writing) does not support In queries through query derivation. There is a ticket to support the In query type.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 12 '18 at 15:15









          mp911demp911de

          9,11021954




          9,11021954












          • Example uses internally or-queries (the same that applies for In) but it queries against a single value and not an array since Example uses the actual domain type as query input type.

            – mp911de
            Nov 12 '18 at 15:18






          • 1





            Spring Data Redis reference docs explain what's working and what is not working. Queries are case-sensitive because all data in Redis is just bytes. Changing lettercasing results in a different binary representation.

            – mp911de
            Nov 12 '18 at 15:39

















          • Example uses internally or-queries (the same that applies for In) but it queries against a single value and not an array since Example uses the actual domain type as query input type.

            – mp911de
            Nov 12 '18 at 15:18






          • 1





            Spring Data Redis reference docs explain what's working and what is not working. Queries are case-sensitive because all data in Redis is just bytes. Changing lettercasing results in a different binary representation.

            – mp911de
            Nov 12 '18 at 15:39
















          Example uses internally or-queries (the same that applies for In) but it queries against a single value and not an array since Example uses the actual domain type as query input type.

          – mp911de
          Nov 12 '18 at 15:18





          Example uses internally or-queries (the same that applies for In) but it queries against a single value and not an array since Example uses the actual domain type as query input type.

          – mp911de
          Nov 12 '18 at 15:18




          1




          1





          Spring Data Redis reference docs explain what's working and what is not working. Queries are case-sensitive because all data in Redis is just bytes. Changing lettercasing results in a different binary representation.

          – mp911de
          Nov 12 '18 at 15:39





          Spring Data Redis reference docs explain what's working and what is not working. Queries are case-sensitive because all data in Redis is just bytes. Changing lettercasing results in a different binary representation.

          – mp911de
          Nov 12 '18 at 15:39

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53264718%2fjava-lang-illegalargumentexception-in-1-isin-inis-not-supported-for-redis%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

          Syphilis

          Darth Vader #20