Java Code Examples for com.alibaba.druid.sql.ast.SQLOrderingSpecification#ASC

The following examples show how to use com.alibaba.druid.sql.ast.SQLOrderingSpecification#ASC . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlanNode.java    From dble with GNU General Public License v2.0 5 votes vote down vote up
public PlanNode orderBy(Item c, SQLOrderingSpecification sortOrder) {
    if (sortOrder == null) {
        sortOrder = SQLOrderingSpecification.ASC;
    }
    Order order = new Order(c, sortOrder);
    if (!this.orderBys.contains(order)) {
        this.orderBys.add(order);
    }
    return this;
}
 
Example 2
Source File: HandlerTool.java    From dble with GNU General Public License v2.0 5 votes vote down vote up
/**
 * make order by from distinct
 *
 * @param selects selects
 * @return order list
 */
public static List<Order> makeOrder(List<Item> selects) {
    List<Order> orders = new ArrayList<>();
    for (Item sel : selects) {
        Order order = new Order(sel, SQLOrderingSpecification.ASC);
        orders.add(order);
    }
    return orders;
}
 
Example 3
Source File: OrderbyColumn.java    From baymax with Apache License 2.0 5 votes vote down vote up
public static OrderbyType buildOrderbyType(SQLOrderingSpecification type){
    if (SQLOrderingSpecification.ASC == type){
        return OrderbyType.ASC;
    }
    if (SQLOrderingSpecification.DESC == type){
        return OrderbyType.DESC;
    }
    return OrderbyType.ASC;
}
 
Example 4
Source File: Order.java    From dble with GNU General Public License v2.0 4 votes vote down vote up
public Order(Item item) {
    this(item, SQLOrderingSpecification.ASC);
}