Package org.modeshape.jcr.query.model

Examples of org.modeshape.jcr.query.model.Ordering


        PropertyExistence constraint = isPropertyExistence(query.constraint());
        assertThat(constraint.getPropertyName(), is("car:model"));
        assertThat(constraint.selectorName(), is(selectorName("car:Car")));
        // ORDER BY ...
        assertThat(query.orderings().size(), is(1));
        Ordering ordering = query.orderings().get(0);
        assertThat(ordering.order(), is(Order.ASCENDING));
        assertThat(ordering.getOperand(), is((DynamicOperand)propertyValue(selectorName("car:Car"), "car:model")));
    }
View Full Code Here


        PropertyExistence constraint = isPropertyExistence(query.constraint());
        assertThat(constraint.getPropertyName(), is("car:model"));
        assertThat(constraint.selectorName(), is(selectorName("car:Car")));
        // ORDER BY ...
        assertThat(query.orderings().size(), is(1));
        Ordering ordering = query.orderings().get(0);
        assertThat(ordering.order(), is(Order.ASCENDING));
        assertThat(ordering.getOperand(), is((DynamicOperand)propertyValue(selectorName("car:Car"), "car:model")));
    }
View Full Code Here

        return Arrays.asList(orderings);
    }

    protected Ordering ascending( String table,
                                  String columnName ) {
        return new Ordering(new PropertyValue(new SelectorName(table), columnName), Order.ASCENDING, NullOrder.NULLS_LAST);
    }
View Full Code Here

        return new Ordering(new PropertyValue(new SelectorName(table), columnName), Order.ASCENDING, NullOrder.NULLS_LAST);
    }

    protected Ordering descending( String table,
                                   String columnName ) {
        return new Ordering(new PropertyValue(new SelectorName(table), columnName), Order.DESCENDING, NullOrder.NULLS_LAST);
    }
View Full Code Here

                                   String columnName ) {
        return new Ordering(new PropertyValue(new SelectorName(table), columnName), Order.DESCENDING, NullOrder.NULLS_LAST);
    }

    protected Ordering ascendingScore( String... tableNames ) {
        return new Ordering(score(tableNames), Order.ASCENDING, NullOrder.NULLS_LAST);
    }
View Full Code Here

    protected Ordering ascendingScore( String... tableNames ) {
        return new Ordering(score(tableNames), Order.ASCENDING, NullOrder.NULLS_LAST);
    }

    protected Ordering descendingScore( String... tableNames ) {
        return new Ordering(score(tableNames), Order.DESCENDING, NullOrder.NULLS_LAST);
    }
View Full Code Here

            this.nullOrder = nullOrder;
            this.builder = builder;
        }

        protected OrderByBuilder addOrdering( DynamicOperand operand ) {
            Ordering ordering = new Ordering(operand, order, nullOrder);
            QueryBuilder.this.orderings.add(ordering);
            return builder;
        }
View Full Code Here

            String property1 = joinCondition.getProperty1Name();
            String property2 = joinCondition.getProperty2Name();

            // Create the Ordering for the first selector/property pair ...
            DynamicOperand operand1 = new PropertyValue(selector1, property1);
            Ordering ordering1 = new Ordering(operand1, Order.ASCENDING, NullOrder.NULLS_LAST);
            // Create the Ordering for the second selector/property pair ...
            DynamicOperand operand2 = new PropertyValue(selector2, property2);
            Ordering ordering2 = new Ordering(operand2, Order.ASCENDING, NullOrder.NULLS_LAST);

            if (leftSelectors.contains(selector1)) {
                leftSortBy.add(ordering1);
                rightSortBy.add(ordering2);
            } else {
View Full Code Here

                case SORT:
                    List<Object> orderBys = node.getPropertyAsList(Property.SORT_ORDER_BY, Object.class);
                    if (orderBys != null && !orderBys.isEmpty()) {
                        if (orderBys.get(0) instanceof Ordering) {
                            for (int i = 0; i != orderBys.size(); ++i) {
                                Ordering ordering = (Ordering)orderBys.get(i);
                                Visitors.visitAll(ordering, collectionVisitor);
                            }
                        }
                    }
                    break;
View Full Code Here

                                orderBys.set(i, replacement);
                            }
                        }
                    } else {
                        for (int i = 0; i != orderBys.size(); ++i) {
                            Ordering ordering = (Ordering)orderBys.get(i);
                            DynamicOperand operand = ordering.getOperand();
                            orderBys.set(i, replaceReferencesToRemovedSource(context, operand, rewrittenSelectors));
                        }
                    }
                }
                break;
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.query.model.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.