本文整理汇总了Java中com.querydsl.core.types.Order.ASC属性的典型用法代码示例。如果您正苦于以下问题:Java Order.ASC属性的具体用法?Java Order.ASC怎么用?Java Order.ASC使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.querydsl.core.types.Order
的用法示例。
在下文中一共展示了Order.ASC属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newSort
@Override
public OrderSpecifier<?> newSort(Expression<?> expr, Direction dir) {
if (dir == Direction.ASC) {
return new OrderSpecifier(Order.ASC, expr);
}
else {
return new OrderSpecifier(Order.DESC, expr);
}
}
示例2: appendOrder
private void appendOrder() {
if (quickFilter.getSortProperty() != null) {
Order order = quickFilter.isAscending() ? Order.ASC : Order.DESC;
query.orderBy(new OrderSpecifier<>(order, Expressions.stringPath(quickFilter.getSortProperty())));
} else if (!Boolean.TRUE.equals(ctx.getCount())) {
if (quickFilter.isRascunho()) {
query.orderBy(new OrderSpecifier<>(Order.ASC, Expressions.stringPath("creationDate")));
} else {
query.orderBy(new OrderSpecifier<>(Order.ASC, Expressions.stringPath("processBeginDate")));
}
}
}
示例3: visit
@Override
public OrderSpecifierList visit(SortNodeList node, QuerydslSortParam filterParam) {
List<SortNode> sortNodes = node.getNodes();
List<OrderSpecifier> orderSpecifiers = new ArrayList<>();
Map<String, Path> mapping = filterParam.getMapping();
for(SortNode sortNode : sortNodes){
Order order = SortNode.Order.DESC.equals(sortNode.getOrder()) ? Order.DESC : Order.ASC;
Path path = mapping.get(sortNode.getField());
OrderSpecifier orderSpecifier = new OrderSpecifier(order, path);
orderSpecifiers.add(orderSpecifier);
}
return new OrderSpecifierList(orderSpecifiers);
}
示例4: createOrderSpecifiers
@SuppressWarnings({ "rawtypes", "unchecked" })
public static OrderSpecifier[] createOrderSpecifiers(
ExtDirectStoreReadRequest request, Class<?> clazz,
EntityPathBase<?> entityPathBase, Map<String, String> mapGuiColumn2Dbfield,
Set<String> sortIgnoreProperties) {
List<OrderSpecifier> orders;
if (!request.getSorters().isEmpty()) {
orders = new ArrayList<>();
PathBuilder<?> entityPath = new PathBuilder<>(clazz,
entityPathBase.getMetadata());
for (SortInfo sortInfo : request.getSorters()) {
if (!sortIgnoreProperties.contains(sortInfo.getProperty())) {
Order order;
if (sortInfo.getDirection() == SortDirection.ASCENDING) {
order = Order.ASC;
}
else {
order = Order.DESC;
}
String property = mapGuiColumn2Dbfield.get(sortInfo.getProperty());
if (property == null) {
property = sortInfo.getProperty();
}
orders.add(new OrderSpecifier(order, entityPath.get(property)));
}
}
}
else {
orders = Collections.emptyList();
}
return orders.toArray(new OrderSpecifier[orders.size()]);
}