Okay sure. You can use this code in the back end : @Transactional @Query("delete from User where u.id in(:integers)") void deleteByIdIn(List integers); Inside controller : @DeleteMapping public String delete(@RequestParam("ids") List ids) { userService.deleteByIdIn(ids); return String.join(",", ids.stream().map(value -> Integer.toString(value)).collect(Collectors.toList())); }
Github link to download the source code :
github.com/sumitMultani/SpringBootAPIGenericResponse.git
sir make a vedio how to delete multiple rows which is selected by check box then delete data my database & java backend through springboot
Okay sure. You can use this code in the back end :
@Transactional
@Query("delete from User where u.id in(:integers)")
void deleteByIdIn(List integers);
Inside controller :
@DeleteMapping
public String delete(@RequestParam("ids") List ids) {
userService.deleteByIdIn(ids);
return String.join(",", ids.stream().map(value -> Integer.toString(value)).collect(Collectors.toList()));
}