From 79f7563ee71fb719e5b343a078438898449d4153 Mon Sep 17 00:00:00 2001 From: Luciano Fiandesio Date: Tue, 7 Jan 2025 22:25:33 +0100 Subject: [PATCH] WIP - 100% IT Tests passing / style --- .../data/AbstractJdbcEventAnalyticsManager.java | 3 ++- .../event/data/JdbcEnrollmentAnalyticsManager.java | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/AbstractJdbcEventAnalyticsManager.java b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/AbstractJdbcEventAnalyticsManager.java index 1689862cd3a..4bd189c3420 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/AbstractJdbcEventAnalyticsManager.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/AbstractJdbcEventAnalyticsManager.java @@ -1095,7 +1095,8 @@ protected String getQueryItemsAndFiltersWhereClause(EventQueryParams params, Sql * @param params the {@link EventQueryParams}. * @param helper the {@link SqlHelper}. */ - protected String getQueryItemsAndFiltersWhereClause(EventQueryParams params, Set exclude, SqlHelper helper) { + protected String getQueryItemsAndFiltersWhereClause( + EventQueryParams params, Set exclude, SqlHelper helper) { if (params.isEnhancedCondition()) { return getItemsSqlForEnhancedConditions(params, helper); } diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEnrollmentAnalyticsManager.java b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEnrollmentAnalyticsManager.java index 85d7092db43..2f95581513e 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEnrollmentAnalyticsManager.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEnrollmentAnalyticsManager.java @@ -535,14 +535,14 @@ private String addCteFiltersToWhereClause(EventQueryParams params, CteContext ct } } // Add filters for items that are not part of the CTE - String nonCteWhereClause = getQueryItemsAndFiltersWhereClause(params, processedItems, new SqlHelper() ) + String nonCteWhereClause = + getQueryItemsAndFiltersWhereClause(params, processedItems, new SqlHelper()) .replace("where", ""); if (nonCteWhereClause.isEmpty()) return cteWhereClause.toString(); String currentWhereClause = cteWhereClause.toString().toLowerCase().trim(); - cteWhereClause.append(currentWhereClause.endsWith("and") - ? nonCteWhereClause - : " and " + nonCteWhereClause); + cteWhereClause.append( + currentWhereClause.endsWith("and") ? nonCteWhereClause : " and " + nonCteWhereClause); return cteWhereClause.toString(); } @@ -563,7 +563,9 @@ private String getSqlFilterValue(QueryFilter filter, QueryItem item) { } // Handle text and numeric values - return item.isNumeric() ? filter.getSqlBindFilter() : sqlBuilder.singleQuote(filter.getSqlBindFilter()); + return item.isNumeric() + ? filter.getSqlBindFilter() + : sqlBuilder.singleQuote(filter.getSqlBindFilter()); } private String buildFilterCteSql(List queryItems, EventQueryParams params) {