diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/AbstractEventJdbcTableManager.java b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/AbstractEventJdbcTableManager.java index 42b02d3f21db..cd7894fb23db 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/AbstractEventJdbcTableManager.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/AbstractEventJdbcTableManager.java @@ -31,6 +31,7 @@ import static org.hisp.dhis.analytics.util.AnalyticsUtils.getColumnType; import static org.hisp.dhis.db.model.DataType.GEOMETRY; import static org.hisp.dhis.db.model.DataType.TEXT; + import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -217,7 +218,7 @@ private List getColumnForOrgUnitAttribute( if (!sqlBuilder.supportsCorrelatedSubquery()) { return List.of(); } - + Validate.isTrue(attribute.getValueType().isOrganisationUnit()); List columns = new ArrayList<>(); diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java index ee2e795cdd97..f5ae60d8af0a 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcEventAnalyticsTableManager.java @@ -41,6 +41,7 @@ import static org.hisp.dhis.system.util.MathUtils.NUMERIC_LENIENT_REGEXP; import static org.hisp.dhis.util.DateUtils.toLongDate; import static org.hisp.dhis.util.DateUtils.toMediumDate; + import java.time.Year; import java.util.ArrayList; import java.util.Collection; @@ -49,6 +50,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import lombok.extern.slf4j.Slf4j; import org.hisp.dhis.analytics.AnalyticsTableHookService; import org.hisp.dhis.analytics.AnalyticsTableType; import org.hisp.dhis.analytics.AnalyticsTableUpdateParams; @@ -86,7 +88,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; -import lombok.extern.slf4j.Slf4j; /** * @author Lars Helge Overland @@ -515,8 +516,8 @@ private List getColumnForDataElement( } /** - * Retyrns a select expression. - * + * Returns a select expression. + * * @param dataElement the {@link DataElement}. * @param columnExpression the column expression. * @return a select expression. @@ -524,7 +525,7 @@ private List getColumnForDataElement( private String getSelectExpression(DataElement dataElement, String columnExpression) { return String.format("%s as %s", columnExpression, quote(dataElement.getUid())); } - + /** * Returns a list of columns. * @@ -536,7 +537,7 @@ private List getColumnForOrgUnitDataElement(DataElement da if (!sqlBuilder.supportsCorrelatedSubquery()) { return List.of(); } - + List columns = new ArrayList<>(); if (isSpatialSupport()) { @@ -618,7 +619,7 @@ private List getColumnForAttributeWithLegendSet( if (!sqlBuilder.supportsCorrelatedSubquery()) { return List.of(); } - + String columnExpression = getColumnExpression(attribute.getValueType(), "value"); String numericClause = getNumericClause("value"); String query = @@ -666,7 +667,7 @@ private List getColumnFromDataElementWithLegendSet( if (!sqlBuilder.supportsCorrelatedSubquery()) { return List.of(); } - + String query = """ (select l.uid from ${maplegend} l \