Examples of MechanicEntity


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

  // ===== Basic operations ===== //
  @Override
  public Long addMechanic(Mechanic mechanic) {
    Long result = null;

    MechanicEntity mechanicEntity = DozerHelper.map(mechanic,
        MechanicEntity.class);
    result = mechanicRepository.save(mechanicEntity);

    return result;
  }
View Full Code Here

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

  @Override
  public Mechanic updateMechanic(Mechanic mechanic) {
    Mechanic result = null;

    MechanicEntity mechanicEntity = DozerHelper.map(mechanic,
        MechanicEntity.class);
    mechanicEntity = mechanicRepository.merge(mechanicEntity);
    result = DozerHelper.map(mechanicEntity, Mechanic.class);

    return result;
View Full Code Here

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

    return result;
  }

  @Override
  public void deleteMechanic(Mechanic mechanic) {
    MechanicEntity mechanicEntity = DozerHelper.map(mechanic,
        MechanicEntity.class);
    mechanicRepository.delete(mechanicEntity);
  }
View Full Code Here

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

  @Override
  public Mechanic getMechanicById(Long id) {
    Mechanic result = null;

    MechanicEntity mechanicEntity = mechanicRepository.findById(id);
    result = DozerHelper.map(mechanicEntity, Mechanic.class);

    return result;
  }
View Full Code Here

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

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

    MechanicEntity mechanicEntity = DozerHelper.map(mechanic,
        MechanicEntity.class);

    List<ReviewEntity> reviewEntities = reviewsRepository.findByMechanic(
        mechanicEntity, amount, position);
    result = DozerHelper.mapList(reviewEntities, Review.class);
View Full Code Here

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

  @Override
  public Mechanic getMechanicByPliRegNo(String pliRegNo)
      throws WrongMechanicPliRegNoException {
    Mechanic result = null;

    MechanicEntity mechanicEntity = mechanicRepository
        .findByPliRegNo(pliRegNo);
    result = DozerHelper.map(mechanicEntity, Mechanic.class);

    return result;
  }
View Full Code Here

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

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

    MechanicEntity mechanicEntity = DozerHelper.map(mechanic,
        MechanicEntity.class);

    List<OrderEntity> orderEntities = orderRepository.findByMechanic(
        mechanicEntity, status, amount, position);
    result = DozerHelper.mapList(orderEntities, Order.class);
View Full Code Here

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

  @Override
  public List<Order> getAvailableOrders(Mechanic mechanic, int amount) {
    List<Order> result = null;

    MechanicEntity mechanicEntity = DozerHelper.map(mechanic,
        MechanicEntity.class);

    List<OrderEntity> orderEntities = orderRepository.findByMechanic(
        mechanicEntity, null, amount, null);
    result = DozerHelper.mapList(orderEntities, Order.class);
View Full Code Here

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

      result = employeeEntity;
    }

    if (source instanceof Mechanic) {
      MechanicEntity mechanicEntity = new MechanicEntity();

      mechanicEntity.setId(source.getId());
      mechanicEntity.setEmail(source.getEmail());
      mechanicEntity.setName(source.getName());
      mechanicEntity.setPassword(source.getPassword());
      mechanicEntity.setPatronymic(source.getPatronymic());
      mechanicEntity.setPhone(source.getPhone());
      mechanicEntity.setPosition(source.getPosition());
      mechanicEntity.setRole(source.getRole());
      mechanicEntity.setSalary(source.getSalary());
      mechanicEntity.setSurname(source.getSurname());
      mechanicEntity.setAverageRating(((Mechanic) source)
          .getAverageRating());
      mechanicEntity.setCurrentOrdersAmount(((Mechanic) source)
          .getCurrentOrdersAmount());

      result = mechanicEntity;
    }
View Full Code Here

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

  }

  @Override
  public MechanicEntity findByPliRegNo(String pliRegNo)
      throws WrongMechanicPliRegNoException {
    MechanicEntity result = null;

    Criterion crPliRegNo = Restrictions.eq("pliRegNo", pliRegNo);
    result = findUniqueByCriteria(crPliRegNo);

    if (result == null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.