title: How can I check several IDs in the same query?
body: <p>I am trying to make a query of multiple IDs to the database in the same table.</p>
  
  <p>The idea is to select different IDs and send them to the controller and that this answer me all the data of the IDs that I have sent.</p>
  
  <p>What I send to the controller</p>
  
  <pre><code>[
      {
          "id": 22
      },
      {
          "id": 23
      },
      {
          "id": 11
      }
  ]
  </code></pre>
  
  <p>The answer that returns me</p>
  
  <p>"JSON parse error: Cannot deserialize instance of co.gov.risaralda.siete.rest.entity.Rol out of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of co.gov.risaralda.siete.rest.entity.Rol out of START_ARRAY token\n at [Source: (PushbackInputStream); line: 1, column: 1]"</p>
  
  <p>Controller:</p>
  
  <pre><code>@PostMapping ("/public/various")
       public List&lt;Rol&gt; listById(@Valid @RequestBody Role role) {
           Object id = role.getId ();
           return rolRepository.findById((Long) id);
       }
  </code></pre>
  
  <p>I know I am not doing well, I would appreciate an example of how I can implement this. Thank you</p>
  
  <p>The desired response is:</p>
  
  <pre><code>[
  {
     "id": 22,
     "name": "ROLE_USER",
     "created_date": "2019-10-04",
     "modified_date": "2019-10-18"
  },
  {
     "id": 23,
     "name": "ROLE_ADMIN",
     "created_date": "2019-10-04",
     "modified_date": "2019-10-18"
  },
  {
     "id": 11,
     "name": "ROLE_LECTURA",
     "created_date": "2019-10-04",
     "modified_date": "2019-10-18"
  }
  ]
  </code></pre>
  
  <p>Repository</p>
  
  <pre><code>@Repository
  public interface RolRepository extends JpaRepository &lt;Role, Serializable&gt; {
       public abstract List &lt;Rol&gt; findById (Long id);
  }
  </code></pre>