added check on max limit

This commit is contained in:
Luca Frosini 2021-11-25 12:30:13 +01:00
parent f0b2c8d61f
commit 186f52cdb5
1 changed files with 4 additions and 3 deletions

View File

@ -49,7 +49,8 @@ public class AccountingPersistenceQueryPostgreSQL implements AccountingPersisten
protected static final Logger logger = LoggerFactory.getLogger(AccountingPersistenceQueryPostgreSQL.class);
public static final String URL_PROPERTY_KEY = AccountingPersistenceConfiguration.URL_PROPERTY_KEY;
// private String baseURL;
public static final int MAX_TOP_LIMIT = 50;
protected AccountingPersistenceBackendQueryConfiguration configuration;
@ -214,8 +215,8 @@ public class AccountingPersistenceQueryPostgreSQL implements AccountingPersisten
orderingProperty = AccountingPersistenceQuery.getDefaultOrderingProperties(clz);
}
if(limit == null) {
limit = 50;
if(limit == null || limit >50) {
limit = MAX_TOP_LIMIT;
}
SortedSet<NumberedFilter> result = new TreeSet<>();