public SortBy sort(String propertyName, SortOrder order) { return new SortByImpl(property(propertyName), order); }
/** * Sets the sort order. * * @param aValue the a value * @param row the row * @param column the column * @param obj the obj */ private void setSortOrder(Object aValue, int row, int column, SortBy obj) { Boolean b = (Boolean) aValue; SortOrder sortOrder = b.booleanValue() ? SortOrder.ASCENDING : SortOrder.DESCENDING; ((SortByImpl) obj).setSortOrder(sortOrder); fireTableCellUpdated(row, column); if (parentObj != null) { parentObj.sortOrderUpdated(); } }
String attribute = element.substring(0, element.length() - 2); clauses.add( new SortByImpl( FeatureUtilities.DEFAULT_FILTER_FACTORY.property( attribute), String attribute = element.substring(0, element.length() - 2); clauses.add( new SortByImpl( FeatureUtilities.DEFAULT_FILTER_FACTORY.property( attribute), if (crsAttribute != null) { SortBy sort = new SortByImpl( FeatureUtilities.DEFAULT_FILTER_FACTORY.property(crsAttribute), SortOrder.ASCENDING);
final List<SortBy> clauses = new ArrayList<SortBy>(1); clauses.add( new SortByImpl( FeatureUtilities.DEFAULT_FILTER_FACTORY.property( CoverageSlice.Attributes.LOCATION),
new SortByImpl( FeatureUtilities.DEFAULT_FILTER_FACTORY.property(locationAttributeName), SortOrder.ASCENDING));
SortBy sortBy = new SortByImpl(propertyName, SortOrder.ASCENDING); SortBy sortBy = new SortByImpl(propertyName, SortOrder.DESCENDING);
new SortByImpl[] {new SortByImpl(propertyName, SortOrder.ASCENDING)};
new SortByImpl( filterFac.property(att), sortBy.getSortOrder())); sort.add(new SortByImpl(filterFac.property(att), SortOrder.ASCENDING)); jQuery.addId(att);
public SortBy sort(String propertyName, SortOrder order) { return new SortByImpl( property( propertyName ), order ); }
public SortBy sort(String propertyName, SortOrder order) { return new SortByImpl( property( propertyName ), order ); }
public void testUniqueWithLimitOnVisitor() throws Exception { if (!dataStore.getSQLDialect().isLimitOffsetSupported() || !dataStore.getSQLDialect().isAggregatedSortSupported("distinct")) { return; } FilterFactory ff = dataStore.getFilterFactory(); PropertyName p = ff.property(aname("stringProperty")); UniqueVisitor v = new MyUniqueVisitor(p); v.setPreserveOrder(true); v.setStartIndex(0); v.setMaxFeatures(2); Query q = new Query(tname("ft1")); q.setSortBy(new SortBy[] {new SortByImpl(p, SortOrder.ASCENDING)}); dataStore.getFeatureSource(tname("ft1")).accepts(q, v, null); assertFalse(visited); Set result = v.getResult().toSet(); assertEquals(2, result.size()); assertEquals("one", result.iterator().next()); }
public void testUniqueWithLimitOffsetOnVisitor() throws Exception { if (!dataStore.getSQLDialect().isLimitOffsetSupported() || !dataStore.getSQLDialect().isAggregatedSortSupported("distinct")) { return; } FilterFactory ff = dataStore.getFilterFactory(); PropertyName p = ff.property(aname("stringProperty")); UniqueVisitor v = new MyUniqueVisitor(p); v.setPreserveOrder(true); v.setStartIndex(1); v.setMaxFeatures(2); Query q = new Query(tname("ft1")); q.setSortBy(new SortBy[] {new SortByImpl(p, SortOrder.ASCENDING)}); dataStore.getFeatureSource(tname("ft1")).accepts(q, v, null); assertFalse(visited); Set result = v.getResult().toSet(); assertEquals(2, result.size()); assertEquals("two", result.iterator().next()); }
public void testStoreChecksVisitorLimits() throws Exception { if (!dataStore.getSQLDialect().isLimitOffsetSupported() || !dataStore.getSQLDialect().isAggregatedSortSupported("distinct")) { return; } FilterFactory ff = dataStore.getFilterFactory(); PropertyName p = ff.property(aname("stringProperty")); UniqueVisitor v = new MyUniqueVisitor(p) { @Override public boolean hasLimits() { // forced to return true, to check that the JDBCDataStore // asks the visitor if it has limits, and if answered true // it ignores query limits return true; } }; v.setPreserveOrder(true); Query q = new Query(tname("ft1")); q.setMaxFeatures(1); q.setSortBy(new SortBy[] {new SortByImpl(p, SortOrder.ASCENDING)}); dataStore.getFeatureSource(tname("ft1")).accepts(q, v, null); assertFalse(visited); Set result = v.getResult().toSet(); assertEquals(3, result.size()); assertEquals("one", result.iterator().next()); }
new SortByImpl( FeatureUtilities.DEFAULT_FILTER_FACTORY.property( timeDimension.getStartAttribute()), new SortByImpl( FeatureUtilities.DEFAULT_FILTER_FACTORY.property( elevationDimension.getStartAttribute()),
@Override public Query adaptQuery(Query query) { Filter filter = query.getFilter(); if (filter != null && !Filter.INCLUDE.equals(filter)) { query.setFilter((Filter) filter.accept(new MDQueryableFilterVisitor(), null)); } SortBy[] sortBy = query.getSortBy(); if (sortBy != null && sortBy.length > 0) { for (int i = 0; i < sortBy.length; i++) { SortBy sb = sortBy[i]; if (!SortBy.NATURAL_ORDER.equals(sb) && !SortBy.REVERSE_ORDER.equals(sb)) { sortBy[i] = new SortByImpl( MDQueryableFilterVisitor.property(sb.getPropertyName()), sb.getSortOrder()); } } query.setSortBy(sortBy); } return query; }
final List<SortBy> clauses = new ArrayList<SortBy>(1); clauses.add( new SortByImpl( FeatureUtilities.DEFAULT_FILTER_FACTORY.property( CoverageSlice.Attributes.LOCATION),
@Override public Query adaptQuery(Query query) { Filter filter = query.getFilter(); if (filter != null && !Filter.INCLUDE.equals(filter)) { Filter qualified = (Filter) filter.accept(NSS_QUALIFIER, null); Filter extended = (Filter) qualified.accept(PATH_EXTENDER, null); query.setFilter(extended); } SortBy[] sortBy = query.getSortBy(); if (sortBy != null && sortBy.length > 0) { CSWPropertyPathExtender extender = new CSWPropertyPathExtender(); for (int i = 0; i < sortBy.length; i++) { SortBy sb = sortBy[i]; if (!SortBy.NATURAL_ORDER.equals(sb) && !SortBy.REVERSE_ORDER.equals(sb)) { PropertyName name = sb.getPropertyName(); PropertyName extended = extender.extendProperty(name, FF, NAMESPACES); sortBy[i] = new SortByImpl(extended, sb.getSortOrder()); } } query.setSortBy(sortBy); } return query; }
sortBy = new SortByImpl(propName, SortOrder.ASCENDING); } else if (visitor instanceof MaxVisitor) { sortBy = new SortByImpl(propName, SortOrder.DESCENDING); } else if (visitor instanceof NearestVisitor) { NearestVisitor nearestVisitor = (NearestVisitor) visitor; + "))"); sortBy = new SortByImpl(expr, SortOrder.ASCENDING);
query.setPropertyNames(Arrays.asList(attribute)); final SortBy[] sortBy=new SortBy[]{ new SortByImpl( FeatureUtilities.DEFAULT_FILTER_FACTORY.property(attribute), SortOrder.ASCENDING
if(element.endsWith(Utils.ASCENDING_ORDER_IDENTIFIER)) { String attribute = element.substring(0, element.length() - 2); clauses.add(new SortByImpl(FeatureUtilities.DEFAULT_FILTER_FACTORY.property(attribute),SortOrder.ASCENDING)); } else clauses.add(new SortByImpl(FeatureUtilities.DEFAULT_FILTER_FACTORY.property(attribute),SortOrder.DESCENDING));