Like I have an ArrayList, Then I call my repo from service, somewhat like
userRepository.insertUsers(userArrayList);
and here i have my repository
@Repository
public interface UserRepository extends JpaRepository<User, Long> {
@Transactional
@Modifying()
@Query("INSERT INTO usermaster ..........")
public int insertUsers(@Param("userArrayList") List<User> userArrayList);
}
all I need is a query to bulk insert this ArrayList above, I couldn't find an answer for this. Thanks in advance.
save? like this:userRepository.save(userArrayList);@Repositoryannotation when you implement on of Spring Datas repository interfaces.