/** Find products by a filter. */
 @Override
 public SearchResult<ProductModel> findProductsByAttributeValues(
     final CategoryModel category,
     final Map<ClassAttributeAssignmentModel, Object> attributeValues,
     final int start,
     final int count) {
   final Map<String, Object> params = new HashMap<String, Object>();
   final String query =
       createQueryToFindProductsByAttributeValues(category, attributeValues, params, true);
   final FlexibleSearchQuery flexibleSearchQuery = new FlexibleSearchQuery(query);
   flexibleSearchQuery.addQueryParameters(params);
   flexibleSearchQuery.setCount(count);
   flexibleSearchQuery.setStart(start);
   flexibleSearchQuery.setNeedTotal(true);
   return search(flexibleSearchQuery);
 }
  @Override
  public List<ClassificationAttributeUnitModel> findAttributeUnits(
      final ClassificationSystemVersionModel systemVersion) {
    final Map<String, Object> params = new HashMap<String, Object>();
    params.put("code", systemVersion.getPk());

    final String query =
        "SELECT {"
            + Item.PK
            + "} FROM {"
            + CatalogConstants.TC.CLASSIFICATIONATTRIBUTEUNIT
            + "} "
            + "WHERE {"
            + ClassificationAttributeUnit.SYSTEMVERSION
            + "}= ?code ";

    final FlexibleSearchQuery flexibleSearchQuery = new FlexibleSearchQuery(query);
    flexibleSearchQuery.addQueryParameters(params);
    flexibleSearchQuery.setCount(-1);
    flexibleSearchQuery.setStart(0);
    flexibleSearchQuery.setNeedTotal(true);
    final SearchResult<ClassificationAttributeUnitModel> results = search(flexibleSearchQuery);
    return results.getResult();
  }