Search in sources :

Example 6 with WithItem

use of net.sf.jsqlparser.statement.select.WithItem in project JSqlParser by JSQLParser.

the class UpsertDeParser method appendSelect.

private void appendSelect(Upsert upsert) {
    buffer.append(" ");
    if (upsert.isUseSelectBrackets()) {
        buffer.append("(");
    }
    if (upsert.getSelect().getWithItemsList() != null) {
        buffer.append("WITH ");
        for (WithItem with : upsert.getSelect().getWithItemsList()) {
            with.accept(selectVisitor);
        }
        buffer.append(" ");
    }
    upsert.getSelect().getSelectBody().accept(selectVisitor);
    if (upsert.isUseSelectBrackets()) {
        buffer.append(")");
    }
}
Also used : WithItem(net.sf.jsqlparser.statement.select.WithItem)

Aggregations

WithItem (net.sf.jsqlparser.statement.select.WithItem)6 ArrayList (java.util.ArrayList)3 Expression (net.sf.jsqlparser.expression.Expression)3 Column (net.sf.jsqlparser.schema.Column)3 Select (net.sf.jsqlparser.statement.select.Select)3 SelectBody (net.sf.jsqlparser.statement.select.SelectBody)3 Test (org.junit.Test)3 Table (net.sf.jsqlparser.schema.Table)2 Iterator (java.util.Iterator)1 Insert (net.sf.jsqlparser.statement.insert.Insert)1 Upsert (net.sf.jsqlparser.statement.upsert.Upsert)1