class AccountEntityService {

    public Pagination<AccountEntity> search(AccountEntitySearch accountEntitySearch, BindingResult errors) {

        try {

            List<AccountEntity> accountentities = new ArrayList<>();
            accountentities.add(accountEntitySearch);
            validate(accountentities, Constants.ACTION_SEARCH, errors);

            if (errors.hasErrors()) {
                throw new CustomBindException(errors);
            }

        } catch (CustomBindException e) {

            throw new CustomBindException(errors);
        }

        return accountEntityRepository.search(accountEntitySearch);
    }

}