@Override public String getNullOrder() { switch (nullOrder()) { case NULLS_FIRST: return QueryObjectModelConstants.JCR_ORDER_NULLS_FIRST; case NULLS_LAST: return QueryObjectModelConstants.JCR_ORDER_NULLS_LAST; } assert false; return null; }
@Override public String getNullOrder() { switch (nullOrder()) { case NULLS_FIRST: return QueryObjectModelConstants.JCR_ORDER_NULLS_FIRST; case NULLS_LAST: return QueryObjectModelConstants.JCR_ORDER_NULLS_LAST; } assert false; return null; }
/** * Create an {@link ExtractFromRow} instance that produces for given row a single object that can be used to sort all rows in * the specified order. * * @param ordering the specification of the sort order; may not be null or empty * @param sourceNamesByAlias the map of selector names keyed by their aliases; may not be null but may be empty * @param context the context in which the query is to be executed; may not be null * @param columns the result column definition; may not be null * @param sources the query sources for the repository; may not be null * @return the extractor; never null */ protected ExtractFromRow createSortingExtractor( Ordering ordering, Map<SelectorName, SelectorName> sourceNamesByAlias, QueryContext context, Columns columns, QuerySources sources ) { DynamicOperand operand = ordering.getOperand(); TypeFactory<?> defaultType = context.getTypeSystem().getStringFactory();// only when ordered column is residual or not // defined ExtractFromRow extractor = createExtractFromRow(operand, context, columns, sources, defaultType, false, false); return RowExtractors.extractorWith(extractor, ordering.order(), ordering.nullOrder()); }
/** * Create an {@link ExtractFromRow} instance that produces for given row a single object that can be used to sort all rows in * the specified order. * * @param ordering the specification of the sort order; may not be null or empty * @param sourceNamesByAlias the map of selector names keyed by their aliases; may not be null but may be empty * @param context the context in which the query is to be executed; may not be null * @param columns the result column definition; may not be null * @param sources the query sources for the repository; may not be null * @return the extractor; never null */ protected ExtractFromRow createSortingExtractor( Ordering ordering, Map<SelectorName, SelectorName> sourceNamesByAlias, QueryContext context, Columns columns, QuerySources sources ) { DynamicOperand operand = ordering.getOperand(); TypeFactory<?> defaultType = context.getTypeSystem().getStringFactory();// only when ordered column is residual or not // defined ExtractFromRow extractor = createExtractFromRow(operand, context, columns, sources, defaultType, false, false); return RowExtractors.extractorWith(extractor, ordering.order(), ordering.nullOrder()); }
@Override public void visit( Ordering ordering ) { ordering.getOperand().accept(this); append(' ').append(ordering.order().symbol()); append(' ').append(ordering.nullOrder().symbol()); } }
@Override public void visit( Ordering ordering ) { ordering.getOperand().accept(this); append(' ').append(ordering.order().symbol()); append(' ').append(ordering.nullOrder().symbol()); } }
DynamicOperand newOperand = replaceViewReferences(context, operand, mappings, node); if (newOperand != operand) { ordering = new Ordering(newOperand, ordering.order(), ordering.nullOrder());
DynamicOperand newOperand = replaceViewReferences(context, operand, mappings, node); if (newOperand != operand) { ordering = new Ordering(newOperand, ordering.order(), ordering.nullOrder());
nullOrder = orderings.get(0).nullOrder();
nullOrder = orderings.get(0).nullOrder();