Package railo.runtime.type

Examples of railo.runtime.type.QueryImpl.sort()


            // sort
            if(sort!=null) {
              String[] arr=sort.toLowerCase().split(",");
              for(int i=arr.length-1;i>=0;i--) {
                String[] col=arr[i].trim().split("\\s+");
                if(col.length==1)qry.sort(KeyImpl.init(col[0].trim()));
                else if(col.length==2) {
                  String order=col[1].toLowerCase().trim();
                  if(order.equals("asc"))
                      qry.sort(KeyImpl.init(col[0]),railo.runtime.type.Query.ORDER_ASC);
                  else if(order.equals("desc"))
View Full Code Here


                String[] col=arr[i].trim().split("\\s+");
                if(col.length==1)qry.sort(KeyImpl.init(col[0].trim()));
                else if(col.length==2) {
                  String order=col[1].toLowerCase().trim();
                  if(order.equals("asc"))
                      qry.sort(KeyImpl.init(col[0]),railo.runtime.type.Query.ORDER_ASC);
                  else if(order.equals("desc"))
                      qry.sort(KeyImpl.init(col[0]),railo.runtime.type.Query.ORDER_DESC);
                  else
                    throw new ApplicationException("invalid order type ["+col[1]+"]");
                }
View Full Code Here

                else if(col.length==2) {
                  String order=col[1].toLowerCase().trim();
                  if(order.equals("asc"))
                      qry.sort(KeyImpl.init(col[0]),railo.runtime.type.Query.ORDER_ASC);
                  else if(order.equals("desc"))
                      qry.sort(KeyImpl.init(col[0]),railo.runtime.type.Query.ORDER_DESC);
                  else
                    throw new ApplicationException("invalid order type ["+col[1]+"]");
                }
              }   
            }
View Full Code Here

           
      int len=orders.size();
      for(int i=len-1;i>=0;i--) {
        ZOrderBy order=(ZOrderBy) orders.get(i);
        ZConstant name=(ZConstant)order.getExpression();
        rtn.sort(name.getValue().toLowerCase(),order.getAscOrder()?Query.ORDER_ASC:Query.ORDER_DESC);
      }
      if(maxrows>-1) {
          rtn.cutRowsTo(maxrows);
      }
    }
View Full Code Here

        if(sort!=null && sort.length>0) {
            int order = sortDirection==SORT_DIRECTION_ASC ? Query.ORDER_ASC : Query.ORDER_DESC;
            for(int i=sort.length-1;i>=0;i--) {
                String item=sort[i];
                if(item.indexOf(' ')!=-1)item=ListUtil.first(item," ",true);
                qry.sort(KeyImpl.getInstance(item),order);
                //keys[i] = new SortKey(item);
            }
        }   
        return qry;
    }
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.