Package org.springframework.data.domain.Sort

Examples of org.springframework.data.domain.Sort.Order


    }catch(NumberFormatException nfe){
      logger.info("paramater page no is invalid, will use 0 as default.");
    }
    Pageable pageable = new PageRequest(Math.max(pageNo, 0),
        ApplicationConfig.masonryPageSize,
        new Sort(new Order(Direction.DESC, "createdAt")));
    if(ApplicationConfig.defaultCityPinyin.equals(city)){
      city = "";
    }
   
    Iterable<Spot> spots = null;
View Full Code Here


  @RemotingInclude
  public ROResult getSpotsAtPage(int at, int size) {
    ROResult result = new ROResult();
    try {
      Pageable pageable = new PageRequest(Math.max(at, 0), size,
          new Sort(new Order(Direction.DESC, "createdAt")));
      Page<Spot> page = spotRepository.findAll(pageable);
      result.setResult(PageVo.from(page));
    } catch (Exception e) {
      result.setErrorCode(new ErrorCode(ErrorCode.BUSINESS_ERROR,
          ErrorCode.ERROR, e.getMessage()));
View Full Code Here

  @RemotingInclude
  public ROResult getUsersAtPage(int at, int size) {
    ROResult result = new ROResult();
    try {
      Pageable pageable = new PageRequest(Math.max(at, 0), size,
          new Sort(new Order(Direction.DESC, "createdAt")));
      Page<User> page = userRepository.findAll(pageable);
      result.setResult(PageVo.from(page));
    } catch (Exception e) {
      result.setErrorCode(new ErrorCode(ErrorCode.BUSINESS_ERROR,
          ErrorCode.ERROR, e.getMessage()));
View Full Code Here

      HttpServletRequest request, HttpSession session){
    User user = userRepository.findOne(id);
    model.addAttribute("user", user);
    Pageable pageable = new PageRequest(no >= 0 ? no : 0,
        ApplicationConfig.masonryPageSize,
        new Sort(new Order(Direction.DESC, "createdAt")));
    Iterable<Spot> spots = spotRepository.findByCreatedBy(id, pageable);
    Collection<PinVo> pins = new ArrayList<PinVo>();
    if(spots!=null){
      pageable = new PageRequest(0,
          ApplicationConfig.pinCmtPageSize,
          new Sort(new Order(Direction.DESC, "createdAt")));
      for(Spot spot : spots){
        Activity act = activityRepository.getByOwnerAndTargetSpotAndType(
            spot.getCreatedBy().getId(), spot.getId(), ActivityType.SPOT.name());
        Page<Comment> cmts = null;
        if(act!=null){
View Full Code Here

      HttpServletRequest request, HttpSession session){
    User user = userRepository.findOne(id);
    model.addAttribute("user", user);
    Pageable pageable = new PageRequest(no >= 0 ? no : 0,
        ApplicationConfig.masonryPageSize,
        new Sort(new Order(Direction.DESC, "createdAt")));
    Iterable<TrackShip> tss = trackShipRepository.findByTrackedAndStatus(id, 0, pageable);
    Collection<PinVo> pins = new ArrayList<PinVo>();
    if(tss!=null){
      pageable = new PageRequest(0,
          ApplicationConfig.pinCmtPageSize,
          new Sort(new Order(Direction.DESC, "createdAt")));
      for(TrackShip ts : tss){
        if(ts.getTarget()==null) continue;
        Spot spot = ts.getTarget();
        Activity act = activityRepository.getByOwnerAndTargetSpotAndType(
            spot.getCreatedBy().getId(), spot.getId(), ActivityType.SPOT.name());
View Full Code Here

TOP

Related Classes of org.springframework.data.domain.Sort.Order

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.