class AccountEntityService {

    @Transactional
    public List<AccountEntity> create(List<AccountEntity> accountEntities, BindingResult errors, RequestInfo requestInfo) {

        try {

            accountEntities = fetchRelated(accountEntities);

            validate(accountEntities, Constants.ACTION_CREATE, errors);

            if (errors.hasErrors()) {
                throw new CustomBindException(errors);
            }
            for (AccountEntity b : accountEntities) {
                b.setId(accountEntityRepository.getNextSequence());
            }

        } catch (CustomBindException e) {

            throw new CustomBindException(errors);
        }

        return accountEntityRepository.save(accountEntities, requestInfo);

    }

}