i have a sql table with 80+columns, and 3 fields as Composite primary key(jobid, itemnbr, whnbr). I want to update the table for multiple rows with composite key as id. jobid value is same.
How can i do this using jpa? Can i use batch for it.
example:
[![Table ][1]][1]
Added query like this:
@Repository
public interface DcInventoryUpdateRepository extends JpaRepository<DcWorklistView,Integer> {
@Modifying
@Transactional
@Query(value = "UPDATE tablename SET " +
"name = :name, qty = :qty "
"WHERE job_id = :jobId AND item_nbr = :itemNbr AND whse_nbr = :whNbr",
nativeQuery = true)
void updateWorklistWithUpdateParams(String name, String qty, int jobId, String itemNbr, String whNbr);