title: Spring Redis Data repository: get multiple hashes by ids at once
body: <h2>Question</h2>
  
  <p><em>Is there any way to use Spring Data Redis' repositories to retrieve multiple hashes at once?</em></p>
  
  <p>My code that does not work:</p>
  
  <pre><code>@RedisHash("Message")
  public class Message implements Serializable {
  
      @Id
      private String id;
      private String text;
      private LocalDateTime posted;
      private Integer upvotes;
      private String authorId;
  }
  
  @Repository
  public interface MessageRepository extends CrudRepository&lt;Message, String&gt; {
      // Got: IN (1): [IsIn, In]is not supported for redis query derivation
      Set&lt;Message&gt; getByIdIn(Set&lt;String&gt; ids); 
  }
  </code></pre>
  
  <h2>Workaround</h2>
  
  <p>Currently I'm using <code>RestTemplate#executePipelined</code>, but I found this approach cumbersome:</p>
  
  <pre><code>public Set&lt;Message&gt; getMessagesById(Set&lt;String&gt; ids) {
  
          // I had to implement custom mapper since BeanUtilsHashMapper fails on LocalDateTime deserialization from String
          HashMapper&lt;Message, String, String&gt; mapper = new DTOConverter&lt;&gt;(Message.class);
  
          List&lt;Object&gt; messages = template.executePipelined((RedisCallback&lt;Object&gt;) connection -&gt; {
              StringRedisConnection conn = (StringRedisConnection) connection;
              ids.stream()
                      .map(id -&gt; "Message:" + id)
                      .forEach(conn::hGetAll);
              return null;
          });
  
          return messages.stream()
                  .map(o -&gt; (Map&lt;String, String&gt;) o)
                  .map(o -&gt; mapper.fromHash(o))
                  .collect(toSet());
  }
  </code></pre>
  
  <p><em>Is there any way to pass <code>mapper</code> to <code>executePipelined</code>?</em></p>