net.hasor.db.jsqlparser.expression.OrderByClause Maven / Gradle / Ivy
The newest version!
/*-
* #%L
* JSQLParser library
* %%
* Copyright (C) 2004 - 2019 JSQLParser
* %%
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
* #L%
*/
package net.sf.jsqlparser.expression;
import net.sf.jsqlparser.statement.select.OrderByElement;
import java.util.List;
public class OrderByClause {
private List orderByElements;
public List getOrderByElements() {
return orderByElements;
}
public void setOrderByElements(List orderByElements) {
this.orderByElements = orderByElements;
}
void toStringOrderByElements(StringBuilder b) {
if (orderByElements != null && !orderByElements.isEmpty()) {
b.append("ORDER BY ");
for (int i = 0; i < orderByElements.size(); i++) {
if (i > 0) {
b.append(", ");
}
b.append(orderByElements.get(i).toString());
}
}
}
}