本文整理了Java中com.vaadin.flow.data.provider.Query.getSortOrders
方法的一些代码示例,展示了Query.getSortOrders
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getSortOrders
方法的具体详情如下:
包路径:com.vaadin.flow.data.provider.Query
类名称:Query
方法名:getSortOrders
[英]Gets the sorting for items to fetch. This list of sort orders is used for sorting backends. The sort orders are only used when fetching items, but not when counting the number of available items.
Note: Sort orders and in-memory sorting are mutually exclusive. If the DataProvider handles one, it should ignore the other.
[中]获取要获取的项的排序。此排序顺序列表用于对后端进行排序。排序顺序仅在获取项目时使用,但在计算可用项目的数量时不使用。
注意:排序顺序和内存排序是相互排斥的。如果数据提供者处理其中一个,它应该忽略另一个。
代码示例来源:origin: com.vaadin/flow-data
private Query<T, F> mixInSortOrders(Query<T, F> query) {
if (sortOrders.isEmpty()) {
return query;
}
Set<String> sortedPropertyNames = query.getSortOrders().stream()
.map(SortOrder::getSorted).collect(Collectors.toSet());
List<QuerySortOrder> combinedSortOrders = Stream
.concat(query.getSortOrders().stream(),
sortOrders.stream()
.filter(order -> !sortedPropertyNames
.contains(order.getSorted())))
.collect(Collectors.toList());
return new Query<>(query.getOffset(), query.getLimit(),
combinedSortOrders, query.getInMemorySorting(),
query.getFilter().orElse(null));
}
代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin-flow
List<QuerySortOrder> orders = query.getSortOrders();
if (orders != null && !orders.isEmpty()) {
orders.forEach(order -> sorts.add(Optional.ofNullable(querySortOrderConverter.apply(order))
代码示例来源:origin: com.vaadin/flow-data
@Override
public Stream<T> fetch(Query<T, F> t) {
return dataProvider.fetch(new Query<>(t.getOffset(), t.getLimit(),
t.getSortOrders(), t.getInMemorySorting(), getFilter(t)));
}
代码示例来源:origin: com.vaadin/flow-data
@Override
public int size(Query<T, F> t) {
return dataProvider.size(new Query<>(t.getOffset(), t.getLimit(),
t.getSortOrders(), t.getInMemorySorting(), getFilter(t)));
}
内容来源于网络,如有侵权,请联系作者删除!