class AccountCodePurposeService {

	public Pagination<AccountCodePurpose> search(AccountCodePurposeSearch accountCodePurposeSearch,
			BindingResult errors) {

		try {

			List<AccountCodePurpose> accountCodePurposes = new ArrayList<>();
			accountCodePurposes.add(accountCodePurposeSearch);
			validate(accountCodePurposes, Constants.ACTION_SEARCH, errors);

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

		} catch (CustomBindException e) {

			throw new CustomBindException(errors);
		}

		return accountCodePurposeRepository.search(accountCodePurposeSearch);
	}

}