use of org.hisp.dhis.query.QueryParserException in project dhis2-core by dhis2.
the class HibernateMinMaxDataElementStore method parseFilter.
private Criteria parseFilter(Criteria criteria, List<String> filters) {
Conjunction conjunction = Restrictions.conjunction();
Schema schema = schemaService.getDynamicSchema(MinMaxDataElement.class);
if (!filters.isEmpty()) {
for (String filter : filters) {
String[] split = filter.split(":");
if (split.length != 3) {
throw new QueryParserException("Invalid filter: " + filter);
}
QueryPath queryPath = queryPlanner.getQueryPath(schema, split[0]);
Property property = queryParser.getProperty(schema, split[0]);
Criterion restriction = getRestriction(property, queryPath.getPath(), split[1], split[2]);
if (restriction != null) {
conjunction.add(restriction);
if (queryPath.haveAlias()) {
for (String alias : queryPath.getAlias()) {
criteria.createAlias(alias, alias);
}
}
}
}
}
criteria.add(conjunction);
return criteria;
}
Aggregations