From: Simon Brandhof Date: Sun, 14 Apr 2019 09:16:09 +0000 (+0200) Subject: SONAR-11882 error if >1000 Permission Templates on Oracle X-Git-Tag: 6.7.7~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b7495c746bdd93374ed4a37ad4fbd04f6e0bd874;p=sonarqube.git SONAR-11882 error if >1000 Permission Templates on Oracle --- 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) {