From b7495c746bdd93374ed4a37ad4fbd04f6e0bd874 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Sun, 14 Apr 2019 11:16:09 +0200 Subject: [PATCH] SONAR-11882 error if >1000 Permission Templates on Oracle --- .../template/PermissionTemplateCharacteristicDao.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/permission/template/PermissionTemplateCharacteristicDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/permission/template/PermissionTemplateCharacteristicDao.java index a05b4640f56..23593047b53 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/permission/template/PermissionTemplateCharacteristicDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/permission/template/PermissionTemplateCharacteristicDao.java @@ -25,13 +25,13 @@ import org.sonar.db.Dao; import org.sonar.db.DbSession; import static com.google.common.base.Preconditions.checkArgument; -import static java.util.Collections.emptyList; import static java.util.Objects.requireNonNull; +import static org.sonar.db.DatabaseUtils.executeLargeInputs; public class PermissionTemplateCharacteristicDao implements Dao { public List selectByTemplateIds(DbSession dbSession, List templateIds) { - return templateIds.isEmpty() ? emptyList() : mapper(dbSession).selectByTemplateIds(templateIds); + return executeLargeInputs(templateIds, partitionOfTemplateIds -> mapper(dbSession).selectByTemplateIds(partitionOfTemplateIds)); } public Optional selectByPermissionAndTemplateId(DbSession dbSession, String permission, long templateId) { -- 2.39.5