Package org.teiid.language

Examples of org.teiid.language.SortSpecification


   
    public static SetQuery example3() throws Exception {
        SetQuery union = example2();
       
        List<SortSpecification> items = new ArrayList<SortSpecification>();
        items.add(new SortSpecification(Ordering.ASC, new ColumnReference(null, "nugent", null, DataTypeManager.DefaultDataClasses.STRING))); //$NON-NLS-1$
        OrderBy orderBy = new OrderBy(items);
       
        union.setOrderBy(orderBy);
        return union;
    }
View Full Code Here


      SortKey sortKey = null;
      sortKeys = new SortKey[orderItems.size()];
      Iterator<SortSpecification> orderItr = orderItems.iterator();
      int i = 0;
      while(orderItr.hasNext()) {
        SortSpecification item = orderItr.next();
        String itemName = getExpressionString(item.getExpression());
        LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Adding sort key for item: " + itemName); //$NON-NLS-1$
        if(item.getOrdering() == Ordering.ASC) {
          LogManager.logTrace(LogConstants.CTX_CONNECTOR, "with ASC ordering."); //$NON-NLS-1$
          sortKey = new SortKey(itemName, true, null);
        } else if(item.getOrdering() == Ordering.DESC){
          LogManager.logTrace(LogConstants.CTX_CONNECTOR, "with DESC ordering."); //$NON-NLS-1$
          sortKey = new SortKey(itemName, false, null);
        }
        sortKeys[i] = sortKey;
        i++;
View Full Code Here

        List<SortSpecification> translatedItems = new ArrayList<SortSpecification>();
        for (int i = 0; i < items.size(); i++) {
            SingleElementSymbol symbol = items.get(i).getSymbol();
            Ordering direction = items.get(i).isAscending() ? Ordering.ASC: Ordering.DESC;
           
            SortSpecification orderByItem = null;                               
            if(items.get(i).isUnrelated() || (!set && symbol instanceof ElementSymbol)){
              orderByItem = new SortSpecification(direction, translate(symbol));                               
            } else {
              orderByItem = new SortSpecification(direction, new ColumnReference(null, symbol.getOutputName(), null, symbol.getType()));
            }
            orderByItem.setNullOrdering(items.get(i).getNullOrdering());
            translatedItems.add(orderByItem);
        }
        return new org.teiid.language.OrderBy(translatedItems);
    }
View Full Code Here

TOP

Related Classes of org.teiid.language.SortSpecification

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.