Examples of OrderBy


Examples of org.crank.crud.criteria.OrderBy

public class CriteriaUtilsTest extends TestCase
{
    public void testOrderBy () {
        /* Create a list of OrderBy objects. */
        List<OrderBy> list = new ArrayList<OrderBy>();
        list.add(new OrderBy("foobar", OrderDirection.ASC));
        list.add(new OrderBy("baz", OrderDirection.DESC));
        /* Make this OrderBy one that is case insensitive. */
        OrderBy bacon = new OrderBy("bacon", OrderDirection.DESC);
        list.add(bacon);
        bacon.setCaseSensitive(false);
        /* Convert the list into an array. */
        OrderBy[] ob = list.toArray(new OrderBy[list.size()]);
        /* Invoke the utility class that constructs the Order By. */
        String orderByClause = CriteriaUtils.constructOrderBy(ob);
        assertEquals(" ORDER BY o.foobar ASC, o.baz DESC, UPPER( o.bacon ) DESC", orderByClause);
View Full Code Here

Examples of org.hibernate.annotations.OrderBy

      collectionBinder.setMapKey( mapKeyAnn );
      collectionBinder.setPropertyName( inferredData.getPropertyName() );
      BatchSize batchAnn = property.getAnnotation( BatchSize.class );
      collectionBinder.setBatchSize( batchAnn );
      javax.persistence.OrderBy ejb3OrderByAnn = property.getAnnotation( javax.persistence.OrderBy.class );
      OrderBy orderByAnn = property.getAnnotation( OrderBy.class );
      collectionBinder.setEjb3OrderBy( ejb3OrderByAnn );
      collectionBinder.setSqlOrderBy( orderByAnn );
      Sort sortAnn = property.getAnnotation( Sort.class );
      collectionBinder.setSort( sortAnn );
      Cache cachAnn = property.getAnnotation( Cache.class );
View Full Code Here

Examples of org.jboss.dna.jcr.xpath.XPath.OrderBy

            }
            if (tokens.hasNext()) {
                steps.add(parseStepExpr(tokens));
            }
        }
        OrderBy orderBy = parseOrderBy(tokens); // may be null
        return new PathExpression(true, steps, orderBy);
    }
View Full Code Here

Examples of org.modeshape.jcr.query.xpath.XPath.OrderBy

            }
            if (tokens.hasNext()) {
                steps.add(parseStepExpr(tokens));
            }
        }
        OrderBy orderBy = parseOrderBy(tokens); // may be null
        return new PathExpression(true, steps, orderBy);
    }
View Full Code Here

Examples of org.qi4j.api.query.grammar.OrderBy

    @Override
    public Query<T> orderBy( Property<?> property, OrderBy.Order order )
    {
        if (orderBySegments == null)
            orderBySegments = Iterables.iterable( new OrderBy( QueryExpressions.property( property ), order ) );
        else
            orderBySegments = Iterables.append( new OrderBy( QueryExpressions.property( property ), order ), orderBySegments );
        return this;
    }
View Full Code Here

Examples of org.teiid.language.OrderBy

        }
        buffer.append(Tokens.SPACE);

        appendSetQuery(obj, obj.getRightQuery(), true);
       
        OrderBy orderBy = obj.getOrderBy();
        if(orderBy != null) {
            buffer.append(Tokens.SPACE);
            append(orderBy);
        }
View Full Code Here

Examples of org.teiid.language.OrderBy

      SetQuery queryCommand = (SetQuery)command;
    if (queryCommand.getLimit() == null) {
      return null;
      }
    Limit limit = queryCommand.getLimit();
    OrderBy orderBy = queryCommand.getOrderBy();
    queryCommand.setLimit(null);
    queryCommand.setOrderBy(null);
    List<Object> parts = new ArrayList<Object>(6);
    parts.add("SELECT "); //$NON-NLS-1$
    parts.addAll(translateLimit(limit, context));
View Full Code Here

Examples of org.teiid.language.OrderBy

    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

Examples of org.teiid.language.OrderBy

        filterBuilder.insert(0, "(&").append("(objectClass=").append(classRestriction).append("))")//$NON-NLS-1$  //$NON-NLS-2$  //$NON-NLS-3$
      }
     
      // Parse the ORDER BY clause.
      // Create an ordered sort list.
      OrderBy orderBy = query.getOrderBy();
      // Referenced the JNDI standard...arguably, this should not be done inside this
      // class, and we should make our own key class. In practice, this makes things simpler.
      SortKey[] sortKeys = getSortKeysFromOrderByClause(orderBy);
     
      // Parse LIMIT clause.
View Full Code Here

Examples of org.teiid.query.sql.lang.OrderBy

    }

    private static PlanNode createSortNode(List<SingleElementSymbol> orderSymbols,
                                           Collection outputElements) {
        PlanNode sortNode = NodeFactory.getNewNode(NodeConstants.Types.SORT);
        sortNode.setProperty(NodeConstants.Info.SORT_ORDER, new OrderBy(orderSymbols));
        sortNode.setProperty(NodeConstants.Info.OUTPUT_COLS, new ArrayList(outputElements));
        return sortNode;
    }
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.