I have a method to update all employees, which is called for every single employee at service layer.
public void updateEmployeeData(Long id, String account) {
queryFactory.update(employee)
.set(employee.employeeAccount, account)
.where(employee.employeeId.eq(id))
.execute();
}
I have to optimize code and call it once with the Lists parameters. For that reason I`ve turned id parameter into List.
public void updateEmployeeData(List<Long> ids, String account) {
queryFactory.update(employee)
.set(employee.employeeAccount, account)
.where(employee.employeeId.in(ids))
.execute();
}
But how to iterate over each employees accounts? I cannot add IN clause to set part of query.
Is there any solution except enhanced For loop and iterating over every single employee?