All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.jsqlparser.statement.piped.OrderByPipeOperator Maven / Gradle / Ivy

Go to download

JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern.

The newest version!
/*-
 * #%L
 * JSQLParser library
 * %%
 * Copyright (C) 2004 - 2025 JSQLParser
 * %%
 * Dual licensed under GNU LGPL 2.1 or Apache License 2.0
 * #L%
 */
package net.sf.jsqlparser.statement.piped;

import net.sf.jsqlparser.statement.select.OrderByElement;

import java.util.List;

public class OrderByPipeOperator extends PipeOperator {
    private List orderByElements;

    public OrderByPipeOperator(List orderByElements) {
        this.orderByElements = orderByElements;
    }

    public List getOrderByElements() {
        return orderByElements;
    }

    public OrderByPipeOperator setOrderByElements(List orderByElements) {
        this.orderByElements = orderByElements;
        return this;
    }

    @Override
    public StringBuilder appendTo(StringBuilder builder) {
        builder.append("|> ")
                .append("ORDER BY ");
        for (OrderByElement orderByElement : orderByElements) {
            builder.append(orderByElement);
        }
        builder.append("\n");
        return builder;
    }

    @Override
    public  T accept(PipeOperatorVisitor visitor, S context) {
        return visitor.visit(this, context);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy