Skip to content

Commit

Permalink
Use bulk update where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
filiphr committed May 14, 2024
1 parent 042d0ce commit 286afff
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,14 @@ public void updateLockTime(String caseInstanceId, Date lockDate, String lockOwne
public void clearLockTime(String caseInstanceId) {
HashMap<String, Object> params = new HashMap<>();
params.put("id", caseInstanceId);
getDbSqlSession().directUpdate("clearCaseInstanceLockTime", params);
getDbSqlSession().update("clearCaseInstanceLockTime", params);
}

@Override
public void clearAllLockTimes(String lockOwner) {
HashMap<String, Object> params = new HashMap<>();
params.put("lockOwner", lockOwner);
getDbSqlSession().directUpdate("clearAllCaseInstanceLockTimes", params);
getDbSqlSession().update("clearAllCaseInstanceLockTimes", params);
}

protected void setSafeInValueLists(CaseInstanceQueryImpl caseInstanceQuery) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ protected void bulkUpdateEntities(String statement, Map<String, Object> paramete
executeChangeWithInClause(entities, entitiesParameter -> {
Map<String, Object> copyParameters = new HashMap<>(parameters);
copyParameters.put(collectionNameInSqlStatement, entitiesParameter);
getDbSqlSession().directUpdate(statement, copyParameters);
getDbSqlSession().update(statement, copyParameters);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,21 +314,21 @@ public void updateProcessInstanceLockTime(String processInstanceId, Date lockDat

@Override
public void updateAllExecutionRelatedEntityCountFlags(boolean newValue) {
getDbSqlSession().directUpdate("updateExecutionRelatedEntityCountEnabled", newValue);
getDbSqlSession().update("updateExecutionRelatedEntityCountEnabled", newValue);
}

@Override
public void clearProcessInstanceLockTime(String processInstanceId) {
HashMap<String, Object> params = new HashMap<>();
params.put("id", processInstanceId);
getDbSqlSession().directUpdate("clearProcessInstanceLockTime", params);
getDbSqlSession().update("clearProcessInstanceLockTime", params);
}

@Override
public void clearAllProcessInstanceLockTimes(String lockOwner) {
HashMap<String, Object> params = new HashMap<>();
params.put("lockOwner", lockOwner);
getDbSqlSession().directUpdate("clearAllProcessInstanceLockTimes", params);
getDbSqlSession().update("clearAllProcessInstanceLockTimes", params);
}

protected void setSafeInValueLists(ExecutionQueryImpl executionQuery) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public boolean updateEventSubscriptionLockTime(String eventSubscriptionId, Date

@Override
public void clearEventSubscriptionLockTime(String eventSubscriptionId) {
getDbSqlSession().directUpdate("clearEventSubscriptionLockTime", eventSubscriptionId);
getDbSqlSession().update("clearEventSubscriptionLockTime", eventSubscriptionId);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void resetExpiredJob(String jobId) {
Map<String, Object> params = new HashMap<>(2);
params.put("id", jobId);
params.put("now", jobServiceConfiguration.getClock().getCurrentTime());
getDbSqlSession().directUpdate("resetExpiredExternalWorkerJob", params);
getDbSqlSession().update("resetExpiredExternalWorkerJob", params);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void bulkUpdateJobLockWithoutRevisionCheck(List<HistoryJobEntity> history
public void resetExpiredJob(String jobId) {
Map<String, Object> params = new HashMap<>(2);
params.put("id", jobId);
getDbSqlSession().directUpdate("resetExpiredHistoryJob", params);
getDbSqlSession().update("resetExpiredHistoryJob", params);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void resetExpiredJob(String jobId) {
Map<String, Object> params = new HashMap<>(2);
params.put("id", jobId);
params.put("now", jobServiceConfiguration.getClock().getCurrentTime());
getDbSqlSession().directUpdate("resetExpiredJob", params);
getDbSqlSession().update("resetExpiredJob", params);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void resetExpiredJob(String jobId) {
Map<String, Object> params = new HashMap<>(2);
params.put("id", jobId);
params.put("now", jobServiceConfiguration.getClock().getCurrentTime());
getDbSqlSession().directUpdate("resetExpiredTimerJob", params);
getDbSqlSession().update("resetExpiredTimerJob", params);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void updateTaskTenantIdForDeployment(String deploymentId, String newTenan

@Override
public void updateAllTaskRelatedEntityCountFlags(boolean newValue) {
getDbSqlSession().directUpdate("updateTaskRelatedEntityCountEnabled", newValue);
getDbSqlSession().update("updateTaskRelatedEntityCountEnabled", newValue);
}

@Override
Expand Down

0 comments on commit 286afff

Please sign in to comment.