I want to update work_withdraw table .My aim to perform update select function at a same time.I want to set my Deposit table pending column data in work_withdraw quantity column , when user call the update api
.enter image description here
I want to set pending data in work_withdraw table quantity column. Here is my query But I am not able to update work_withdraw table through using JPA query DepositRepository.kt
package com.nilmani.workload.repository
import com.nilmani.workload.entity.Deposit
import com.nilmani.workload.entity.WorkWithdraw
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Modifying
import org.springframework.data.jpa.repository.Query
import org.springframework.transaction.annotation.Transactional
import org.springframework.web.bind.annotation.RequestParam
interface DepositRepository:JpaRepository<Deposit,Long> {
@Modifying
@Transactional
@Query("update Ww SET Ww .quantity = d .pending FROM WorkWithdraw AS Ww INNER JOIN Deposit AS d ON Ww.id = d.id")
fun getPendingStatus(@RequestParam("id")id: WorkWithdraw):Long
}
I want update the table worker_withdraw automatically when admin enter the worker_withdraw id But My query Not existing as what Type of Result I want

