Examples of SubsidiaryEntity


Examples of com.expositds.ars.dao.entity.billing.SubsidiaryEntity

  // ===== Basic operations ===== //
  @Override
  public Long addSubsidiary(Subsidiary subsidiary) {
    Long result = null;

    SubsidiaryEntity subsidiaryEntity = DozerHelper.map(subsidiary,
        SubsidiaryEntity.class);
    result = subsidiaryRepository.save(subsidiaryEntity);

    return result;
  }
View Full Code Here

Examples of com.expositds.ars.dao.entity.billing.SubsidiaryEntity

  @Override
  public Subsidiary updateSubsidiary(Subsidiary subsidiary) {
    Subsidiary result = null;

    SubsidiaryEntity subsidiaryEntity = DozerHelper.map(subsidiary,
        SubsidiaryEntity.class);
    subsidiaryEntity = subsidiaryRepository.merge(subsidiaryEntity);
    result = DozerHelper.map(subsidiaryEntity, Subsidiary.class);

    return result;
View Full Code Here

Examples of com.expositds.ars.dao.entity.billing.SubsidiaryEntity

    return result;
  }

  @Override
  public void deleteSubsidiary(Subsidiary subsidiary) {
    SubsidiaryEntity subsidiaryEntity = DozerHelper.map(subsidiary,
        SubsidiaryEntity.class);
    subsidiaryRepository.delete(subsidiaryEntity);
  }
View Full Code Here

Examples of com.expositds.ars.dao.entity.billing.SubsidiaryEntity

  @Override
  public Subsidiary getSubsidiaryById(Long id) {
    Subsidiary result = null;

    SubsidiaryEntity subsidiaryEntity = subsidiaryRepository.findById(id);
    result = DozerHelper.map(subsidiaryEntity, Subsidiary.class);

    return result;
  }
View Full Code Here

Examples of com.expositds.ars.dao.entity.billing.SubsidiaryEntity

      throws WrongSubsidiaryEmployeeException {
    Subsidiary result = null;

    EmployeeEntity employeeEntity = DozerHelper.map(employee,
        EmployeeEntity.class);
    SubsidiaryEntity subsidiaryEntity = subsidiaryRepository
        .findByEmployee(employeeEntity);
    result = DozerHelper.map(subsidiaryEntity, Subsidiary.class);

    return result;
  }
View Full Code Here

Examples of com.expositds.ars.dao.entity.billing.SubsidiaryEntity

  }

  @Override
  public SubsidiaryEntity findByEmployee(EmployeeEntity employeeEntity)
      throws WrongSubsidiaryEmployeeException {
    SubsidiaryEntity result = null;

    Criteria cr = getSession().createCriteria(SubsidiaryEntity.class)
        .createCriteria("employees")
        .add(Restrictions.eq("id", employeeEntity.getId()));
    result = (SubsidiaryEntity) cr.uniqueResult();
View Full Code Here

Examples of com.expositds.ars.dao.entity.billing.SubsidiaryEntity

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

    SubsidiaryEntity subsidiaryEntity = DozerHelper.map(subsidiary,
        SubsidiaryEntity.class);

    List<EmployeeEntity> employeeEntities = employeeRepository
        .findBySubsidiary(subsidiaryEntity, amount, position);
    result = DozerHelper.mapList(employeeEntities, Employee.class);
View Full Code Here

Examples of com.expositds.ars.dao.entity.billing.SubsidiaryEntity

      incomingPaymentEntity.setPayer(customerEntity);
      incomingPaymentEntity.setPaymentDate(source.getPaymentDate());
      incomingPaymentEntity.setSubject(source.getSubject());

      SubsidiaryEntity subsidiaryEntity = DozerHelper.map(
          source.getSubsidiary(), SubsidiaryEntity.class);
      incomingPaymentEntity.setSubsidiary(subsidiaryEntity);

      incomingPaymentEntity.setTotal(source.getTotal());
      incomingPaymentEntity.setType(source.getType());

      result = incomingPaymentEntity;
    }

    if (source instanceof OutgoingPayment) {
      OutgoingPaymentEntity outgoingPaymentEntity = new OutgoingPaymentEntity();

      outgoingPaymentEntity.setCompleted(source.isCompleted());
      outgoingPaymentEntity.setCreationDate(source.getCreationDate());
      outgoingPaymentEntity.setId(source.getId());
      outgoingPaymentEntity.setPaymentDate(source.getPaymentDate());

      Employee employee = ((OutgoingPayment) source).getRecipient();
      EmployeeEntity employeeEntity = null;
      if (employee instanceof Mechanic) {
        employeeEntity = DozerHelper.map(employee, MechanicEntity.class);
      }
      if (employee instanceof Employee) {
        employeeEntity = DozerHelper.map(employee, EmployeeEntity.class);
      }

      outgoingPaymentEntity.setRecipient(employeeEntity);
      outgoingPaymentEntity.setSubject(source.getSubject());

      SubsidiaryEntity subsidiaryEntity = DozerHelper.map(
          source.getSubsidiary(), SubsidiaryEntity.class);
      outgoingPaymentEntity.setSubsidiary(subsidiaryEntity);
      outgoingPaymentEntity.setTotal(source.getTotal());
      outgoingPaymentEntity.setType(source.getType());
View Full Code Here

Examples of com.expositds.ars.dao.entity.billing.SubsidiaryEntity

  public List<Employee> getEmployeesByPosition(Subsidiary subsidiary,
      String position, Integer page) {
    List<Employee> result = null;
    Integer amount = null;
    Integer position_ = null;
    SubsidiaryEntity subsidiaryEntity = null;

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

Examples of com.expositds.ars.dao.entity.billing.SubsidiaryEntity

  public List<Employee> getEmployeesBySalary(Subsidiary subsidiary,
      Float salaryLo, Float salaryHi, Integer page) {
    List<Employee> result = null;
    Integer amount = null;
    Integer position = null;
    SubsidiaryEntity subsidiaryEntity = null;

    if (page != null) {
      position = (page - 1) * EMPLOYEES_PER_PAGE;
      amount = EMPLOYEES_PER_PAGE;
    }
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.