use of org.hisp.dhis.antlr.ParserException in project dhis2-core by dhis2.
the class DefaultProgramIndicatorService method getAnyValueExistsClauseAnalyticsSql.
@Override
@Transactional(readOnly = true)
public String getAnyValueExistsClauseAnalyticsSql(String expression, AnalyticsType analyticsType) {
if (expression == null) {
return null;
}
try {
Set<String> uids = getDataElementAndAttributeIdentifiers(expression, analyticsType);
if (uids.isEmpty()) {
return null;
}
String sql = StringUtils.EMPTY;
for (String uid : uids) {
sql += statementBuilder.columnQuote(uid) + " is not null or ";
}
return TextUtils.removeLastOr(sql).trim();
} catch (ParserException e) {
return null;
}
}
Aggregations