Package net.baguajie.vo

Examples of net.baguajie.vo.ActivityVo


  }

  private Collection<ActivityVo> toActVos(Iterable<Activity> acts){
    Collection<ActivityVo> activities = new ArrayList<ActivityVo>();
    for(Activity act : acts){
      ActivityVo vo = ActivityVo.from(act);
      if(act.getOwner()!=null){
        User owner = userRepository.findOne(act.getOwner());
        vo.setOwner(owner);
      }
      if(act.getTargetSpot()!=null){
        Spot spot = spotRepository.findOne(act.getTargetSpot());
        vo.setTargetSpot(spot);
      }
      if(act.getTargetUser()!=null){
        User targetUser = userRepository.findOne(act.getTargetUser());
        vo.setTargetUser(targetUser);
      }
      if(StringUtils.hasText(act.getBasedOn())){
        Activity basedOnAct = activityRepository.findOne(act.getBasedOn());
        ActivityVo basedOn = ActivityVo.from(basedOnAct);
        basedOn.setOwner(userRepository.findOne(basedOnAct.getOwner()));
        vo.setBasedOn(basedOn);
      }
      activities.add(vo);
    }
    return activities;
View Full Code Here


        ApplicationConfig.listPageSize,
        new Sort(new Order(Direction.DESC, "createdAt")));
    Iterable<Activity> acts = activityRepository.findByOwner(id, pageable);
    Collection<ActivityVo> activities = new ArrayList<ActivityVo>();
    for(Activity act : acts){
      ActivityVo vo = ActivityVo.from(act);
      if(act.getOwner()!=null){
        User owner = userRepository.findOne(act.getOwner());
        vo.setOwner(owner);
      }
      if(act.getTargetSpot()!=null){
        Spot spot = spotRepository.findOne(act.getTargetSpot());
        vo.setTargetSpot(spot);
      }
      if(act.getTargetUser()!=null){
        User targetUser = userRepository.findOne(act.getTargetUser());
        vo.setTargetUser(targetUser);
      }
      activities.add(vo);
    }
    model.addAttribute("activities", activities);
    return "profiles/activities";
View Full Code Here

TOP

Related Classes of net.baguajie.vo.ActivityVo

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.