title: How do you handle with bulk deleting by an array of IDs in Spring Data JPA?
body: <p>Now I have a class User, I get a request data of an <code>array</code> from  the <code>jsp</code> or <code>html</code>.</p>
  
  <p>list this <code>Integer[] arr=[5,6,9,10,62,52,21]</code></p>
  
  <p>and then I use two methods to finish bulking deleting action.</p>
  
  <pre><code>@Transactional
  @Override
  public void deleteUser(Integer id) {
  
      oneRepository.delete(id);
  }
  
  
  @Transactional
  @Override
  public void deleteSomeUser(Integer[] ids) {
  
      for (Integer id : ids) {
  
          deleteUser(id);
  
      }
  
  }
  </code></pre>
  
  <p>I want to know that  if it's a more efficient method to finish this action.</p>
  
  <p>you can see my logs:
  it seems not so good!</p>
  
  <pre><code>[94, 95, 91, 92, 93]
  Hibernate: 
      delete 
      from
          sshh_user 
      where
          ID=?
  
  
  Hibernate: 
      delete 
      from
          sshh_user 
      where
          ID=?
  
  
  
  Hibernate: 
      delete 
      from
          sshh_user 
      where
          ID=?
  
  
  
  Hibernate: 
      delete 
      from
          sshh_user 
      where
          ID=?
  
  
  
  Hibernate: 
      delete 
      from
          sshh_user 
      where
          ID=?
  
  
  
  Hibernate: 
      select
          count(practice0_.ID) as col_0_0_ 
      from
          sshh_user practice0_
  </code></pre>