public FilterHelper(Map filters,
Dialect dialect,
SQLFunctionRegistry functionRegistry) {
int filterCount = filters.size();
filterNames = new String[filterCount];
filterConditions = new String[filterCount];
Iterator iter = filters.entrySet().iterator();
filterCount = 0;
while ( iter.hasNext() ) {
final Map.Entry entry = (Map.Entry) iter.next();
filterNames[filterCount] = (String) entry.getKey();
filterConditions[filterCount] = Template.renderWhereStringTemplate(
(String) entry.getValue(),
FilterImpl.MARKER,
dialect,
functionRegistry
);
filterConditions[filterCount] = StringHelper.replace( filterConditions[filterCount],
":",
":" + filterNames[filterCount] + "." );
filterCount++;
}
}
The map of defined filters. This is expected to be in format
where the filter names are the map keys, and the defined
conditions are the values. Parameters:
filters - The map of defined filters.
dialect - The sql dialect
functionRegistry - The SQL function registry
|