Package com.mustafaiev.tair.cts.model

Examples of com.mustafaiev.tair.cts.model.Payer


    }
  }

  @Override
  public Payer retrievePayer(final Long payerId) {
    Payer payer = null;
    try {
      payer = (Payer) this.hibernateTemplate.get(Payer.class, payerId);
    } catch (final HibernateException e) {
      LOGGER.error(e);
    }
View Full Code Here


  @Override
  public Payer findActiveByEmail(final String email)
      throws DataNotRetrievedException {
    final Session session = this.hibernateTemplate.getSessionFactory()
        .openSession();
    Payer payer = null;
    try {
      final Query query = session.createQuery(SELECT_PAYER_BY_EMAIL);
      query.setString(0, email);
      payer = (Payer) query.uniqueResult();
    } catch (final HibernateException e) {
View Full Code Here

  @Transactional
  public Payer findByEmail(final String email)
      throws DataNotRetrievedException {
    final Session session = this.hibernateTemplate.getSessionFactory()
        .openSession();
    Payer payer = null;
    try {
      final Query query = session.createQuery(SELECT_PAYER_BY_EMAIL);
      query.setString(0, email);
      payer = (Payer) query.uniqueResult();
    } catch (final HibernateException e) {
View Full Code Here

  }

  @Override
  public PayerDTO retrievePayer(final Long payerId)
      throws DataNotRetrievedException {
    final Payer payer = this.payerDao.retrievePayer(payerId);
    final PayerDTO dto = this.mapper.map(payer, PayerDTO.class);
    dto.setId(payer.getId());
    return dto;
  }
View Full Code Here

  }

  @Override
  public PayerDTO findPayer(final String payerId)
      throws DataNotRetrievedException {
    final Payer payer = this.payerDao.findByEmail(payerId);
    PayerDTO dto = null;
    if (payer != null) {
      dto = this.mapper.map(payer, PayerDTO.class);
      dto.setId(payer.getId());
    }
    return dto;
  }
View Full Code Here

  }

  @Override
  public PayerDTO retrieveActiveByEmail(final String email)
      throws DataNotRetrievedException {
    final Payer payer = this.payerDao.findActiveByEmail(email.trim());
    PayerDTO dto = null;
    if (payer != null) {
      dto = this.mapper.map(payer, PayerDTO.class);
      dto.setId(payer.getId());
    }
    return dto;
  }
View Full Code Here

  }

  private List<Payer> convertList(final List<PayerDTO> list) {
    final List<Payer> payers = new ArrayList<Payer>();
    for (final PayerDTO payerDto : list) {
      final Payer payer = this.mapper.map(payerDto, Payer.class);
      payers.add(payer);
    }
    return payers;
  }
View Full Code Here

  }

  @Override
  public void savePayer(final PayerDTO payerDto)
      throws DataNotStoredException {
    final Payer payer = this.mapper.map(payerDto, Payer.class);
    try {
      final StandardPasswordEncoder encoder = new StandardPasswordEncoder();
      final String encodedPassword = encoder.encode(payerDto
          .getPassword());
      payer.setPassword(encodedPassword);
      this.payerDao.doSave(payer);
    } catch (final DataNotStoredException e) {
      LOGGER.error(e.getLocalizedMessage(), e);
      throw new DataNotStoredException(e.getLocalizedMessage());
    }
View Full Code Here

  }

  @Override
  public void updatePayer(final PayerDTO payerDto)
      throws DataNotStoredException {
    final Payer payer = this.mapper.map(payerDto, Payer.class);
    try {
      payer.setId(payerDto.getId());
      this.payerDao.doUpdate(payer);
    } catch (final DataNotStoredException e) {
      LOGGER.error(e.getLocalizedMessage(), e);
      throw new DataNotStoredException(e.getLocalizedMessage());
    }
View Full Code Here

TOP

Related Classes of com.mustafaiev.tair.cts.model.Payer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.