update two rows having same id by using JPA hibernate spring boot

Viewed 19

my table is my table is

i want update these two rows like adding last column value to true I am using JPA Repository

@Repository
public interface IndexerErrorItemRepo extends JpaRepository<IndexerErrorItem, Long> {
public String query = "update IndexerErrorItem c set c.graveyard = ?1 where c.fileid = ?2";

@Transactional
@Modifying
@Query(query)
int updateIndexerErrorItem(Boolean graveyard, Long fileid);

Optional<IndexerErrorItem> findByFileid(Long fileid);
0 Answers
Related