private FilterInfo getFilterInfo(Criterion filter) {
final FilterInfo filterInfo = new FilterInfo();
final QueryBuilder queryBuilder = QueryBuilder.forAlias("profileResourceNode").createAlias("format");
queryBuilder.add(filter);
final String ejbQl = queryBuilder.toEjbQl();
// If we have a filter, get its SQL query string and parameter values:
if (ejbQl.length() > 0) {
filterInfo.setFilterSubQuery(buildFilterSubQuery(ejbQl));
filterInfo.setFilterValues(queryBuilder.getValues());