Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.Ordering


     * @throws RepositoryException if an error occurs.
     */
    protected QueryObjectModel createQOM(boolean ascending)
            throws RepositoryException {
        DynamicOperand op = createOrderingOperand();
        Ordering ordering;
        if (ascending) {
            ordering = qf.ascending(op);
        } else {
            ordering = qf.descending(op);
        }
View Full Code Here


    }

    @Test
    public void ascending() throws RepositoryException {
        PropertyValue p = f.propertyValue("selectorName", "propertyName");
        Ordering o = f.ascending(p);
        assertEquals(p, o.getOperand());
        assertEquals(QueryObjectModelConstants.JCR_ORDER_ASCENDING, o.getOrder());
    }
View Full Code Here

    }

    @Test
    public void descending() throws RepositoryException {
        PropertyValue p = f.propertyValue("selectorName", "propertyName");
        Ordering o = f.descending(p);
        assertEquals(p, o.getOperand());
        assertEquals(QueryObjectModelConstants.JCR_ORDER_DESCENDING, o.getOrder());
    }
View Full Code Here

        Selector s = f.selector("nodeTypeName", "x");
        BindVariableValue b = f.bindVariable("var");
        Constraint c = f.propertyExistence("x", "c");
        PropertyValue p = f.propertyValue("x", "propertyName");
        c = f.and(f.comparison(p, QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, b), c);
        Ordering o = f.ascending(p);
        Column col = f.column("selectorName", "propertyName", "columnName");
        Ordering[] ords = new Ordering[]{o};
        Column[] cols = new Column[]{col};
        QueryObjectModel q = f.createQuery(s, c, ords, cols);
        // assertEquals(Query.JCR_SQL2, q.getLanguage());
View Full Code Here

    }

    private Ordering[] parseOrder() throws RepositoryException {
        ArrayList<Ordering> orderList = new ArrayList<Ordering>();
        do {
            Ordering ordering;
            DynamicOperand op = parseDynamicOperand();
            if (readIf("DESC")) {
                ordering = factory.descending(op);
            } else {
                readIf("ASC");
View Full Code Here

     * @throws RepositoryException if an error occurs.
     */
    protected QueryObjectModel createQOM(boolean ascending)
            throws RepositoryException {
        DynamicOperand op = createOrderingOperand();
        Ordering ordering;
        if (ascending) {
            ordering = qf.ascending(op);
        } else {
            ordering = qf.descending(op);
        }
View Full Code Here

    }

    private Ordering[] parseOrder() throws RepositoryException {
        ArrayList<Ordering> orderList = new ArrayList<Ordering>();
        do {
            Ordering ordering;
            DynamicOperand op = parseDynamicOperand();
            if (readIf("DESC")) {
                ordering = factory.descending(op);
            } else {
                readIf("ASC");
View Full Code Here

    }

    @Test
    public void ascending() throws RepositoryException {
        PropertyValue p = f.propertyValue("selectorName", "propertyName");
        Ordering o = f.ascending(p);
        assertEquals(p, o.getOperand());
        assertEquals(QueryObjectModelConstants.JCR_ORDER_ASCENDING, o.getOrder());
        assertEquals("[selectorName].[propertyName]", p.toString());
    }
View Full Code Here

    }

    @Test
    public void descending() throws RepositoryException {
        PropertyValue p = f.propertyValue("selectorName", "propertyName");
        Ordering o = f.descending(p);
        assertEquals(p, o.getOperand());
        assertEquals(QueryObjectModelConstants.JCR_ORDER_DESCENDING, o.getOrder());
        assertEquals("[selectorName].[propertyName] DESC", o.toString());
    }
View Full Code Here

        Selector s = f.selector("nodeTypeName", "x");
        BindVariableValue b = f.bindVariable("var");
        Constraint c = f.propertyExistence("x", "c");
        PropertyValue p = f.propertyValue("x", "propertyName");
        c = f.and(f.comparison(p, QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, b), c);
        Ordering o = f.ascending(p);
        Column col = f.column("x", "propertyName", "columnName");
        Ordering[] ords = new Ordering[]{o};
        Column[] cols = new Column[]{col};
        QueryObjectModel q = f.createQuery(s, c, ords, cols);
        assertEquals(Query.JCR_JQOM, q.getLanguage());
View Full Code Here

TOP

Related Classes of javax.jcr.query.qom.Ordering

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.