Package com.expositds.ars.dao.entity.user

Examples of com.expositds.ars.dao.entity.user.UserEntity


      throws WrongEmailPasswordPairException {
    boolean result = false;

    String passwordHash = MD5(password);

    UserEntity userEntity = userRepository.findByCredentials(email,
        passwordHash);

    User user = DozerHelper.map(userEntity, User.class);

    SessionEntity sessionEntity = sessionRepository.findByUserId(user
View Full Code Here


    super(User.class, UserEntity.class);
  }

  @Override
  public UserEntity convertTo(User source, UserEntity destination) {
    UserEntity result = null;
   
    if (source instanceof Mechanic) {
      result = DozerHelper.map(source, MechanicEntity.class);
    }
   
View Full Code Here

  }

  @Override
  public User convertFrom(UserEntity source, User destination) {
    User result = null;
    UserEntity tmp = null;
   
    if (source != null) {
      tmp = HibernateHelper.initializeAndUnproxy(source);
    }
   
View Full Code Here

  }

  @Override
  public UserEntity findByCredentials(String email, String password)
      throws WrongEmailPasswordPairException {
    UserEntity result = null;

    Criterion crEmail = Restrictions.eq("email", email);
    Criterion crPassword = Restrictions.eq("password", password);

    result = findUniqueByCriteria(crEmail, crPassword);
View Full Code Here

    return result;
  }

  @Override
  public UserEntity findByEmail(String email) throws WrongEmailException {
    UserEntity result = null;

    Criterion crEmail = Restrictions.eq("email", email);
    result = findUniqueByCriteria(crEmail);

    if (result == null) {
View Full Code Here

    if (page != null) {
      position = (page - 1) * NOTIFICATIONS_PER_PAGE;
      amount = NOTIFICATIONS_PER_PAGE;
    }

    UserEntity userEntity = DozerHelper.map(user, UserEntity.class);

    List<NotificationEntity> notificationEntities = notificationRepository
        .findByRecipient(userEntity, viewed, amount, position);
    result = DozerHelper.mapList(notificationEntities, Notification.class);

View Full Code Here

  @Override
  public int getAmountOfNotifications(User user, Boolean viewed) {
    int result = 0;

    UserEntity userEntity = DozerHelper.map(user, UserEntity.class);
    result = notificationRepository.getAmountOfNotificationsByRecipient(
        userEntity, viewed);

    return result;
  }
View Full Code Here

  public List<Notification> getNotificationsBySubject(User user,
      String subject, Boolean viewed, Integer page) {
    List<Notification> result = null;
    Integer amount = null;
    Integer position = null;
    UserEntity userEntity = null;

    if (page != null) {
      position = (page - 1) * NOTIFICATIONS_PER_PAGE;
      amount = NOTIFICATIONS_PER_PAGE;
    }
View Full Code Here

  @Override
  public List<Notification> getLastNotifications(User user, int amount) {
    List<Notification> result = null;

    UserEntity userEntity = DozerHelper.map(user, UserEntity.class);
    List<NotificationEntity> notifications = notificationRepository
        .findByRecipient(userEntity, null, amount, null);
    result = DozerHelper.mapList(notifications, Notification.class);

    return result;
View Full Code Here

TOP

Related Classes of com.expositds.ars.dao.entity.user.UserEntity

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.