finished findByAttributes function (AbstractCriteriaService.java)