Package com.expositds.ars.dao.entity.order

Examples of com.expositds.ars.dao.entity.order.ActivityEntity


    super(Activity.class, ActivityEntity.class);
  }

  @Override
  public ActivityEntity convertTo(Activity source, ActivityEntity destination) {
    ActivityEntity result = null;

    if (source instanceof Service) {

      ServiceEntity serviceEntity = new ServiceEntity();
      serviceEntity.setId(source.getId());
View Full Code Here


  @SuppressWarnings("deprecation")
  @Override
  public Activity convertFrom(ActivityEntity source, Activity destination) {
    Activity result = null;
    ActivityEntity tmp = null;

    if (source != null) {
      tmp = HibernateHelper.initializeAndUnproxy(source);
    }   

    if (tmp instanceof ServiceEntity) {
      Service service = new Service();
      service.setId(tmp.getId());
      service.setDescription(((ServiceEntity) tmp).getDescription());
      service.setElapsedTime(tmp.getElapsedTime());
      service.setNote(tmp.getNote());
      service.setTotal(tmp.getTotal());

      result = service;
    }

    if (tmp instanceof DetailReplacementEntity) {
      DetailReplacement detailReplacement = new DetailReplacement();
      detailReplacement.setId(tmp.getId());

      DetailEntity detailEntity = ((DetailReplacementEntity) tmp)
          .getDetail();
      Detail detail = DozerHelper.map(detailEntity, Detail.class);

      detailReplacement.setDetail(detail);
      detailReplacement.setElapsedTime(tmp.getElapsedTime());
      detailReplacement.setNote(tmp.getNote());
      detailReplacement.setTotal(tmp.getTotal());

      result = detailReplacement;
    }

    return result;
View Full Code Here

  // ===== Basic operations ===== //
  @Override
  public Long addActivity(Activity activity) {
    Long result = null;

    ActivityEntity activityEntity = DozerHelper.map(activity,
        ActivityEntity.class);
    result = activityRepository.save(activityEntity);

    return result;
  }
View Full Code Here

  @Override
  public Activity updateActivity(Activity activity) {
    Activity result = null;

    ActivityEntity activityEntity = DozerHelper.map(activity,
        ActivityEntity.class);
    activityEntity = activityRepository.merge(activityEntity);
    result = DozerHelper.map(activityEntity, Activity.class);

    return result;
View Full Code Here

    return result;
  }

  @Override
  public void deleteActivity(Activity activity) {
    ActivityEntity activityEntity = DozerHelper.map(activity,
        ActivityEntity.class);
    activityRepository.delete(activityEntity);

  }
View Full Code Here

  @Override
  public Activity getActivityById(Long id) {
    Activity result = null;

    ActivityEntity activityEntity = activityRepository.findById(id);
    result = DozerHelper.map(activityEntity, Activity.class);

    return result;
  }
View Full Code Here

TOP

Related Classes of com.expositds.ars.dao.entity.order.ActivityEntity

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.