Skip to content

Commit f30d0bf

Browse files
Merge branch 'master' into feature/exasol-import-export
2 parents 82e2f78 + abca809 commit f30d0bf

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

src/main/java/net/sf/jsqlparser/statement/select/FromItemVisitorAdapter.java

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,24 @@
1313
import net.sf.jsqlparser.statement.imprt.Import;
1414
import net.sf.jsqlparser.statement.piped.FromQuery;
1515

16+
import java.util.ArrayList;
17+
1618
@SuppressWarnings({"PMD.UncommentedEmptyMethodBody"})
1719
public class FromItemVisitorAdapter<T> implements FromItemVisitor<T> {
1820

1921
@Override
2022
public <S> T visit(Table table, S context) {
21-
2223
return null;
2324
}
2425

2526
@Override
2627
public <S> T visit(ParenthesedSelect select, S context) {
27-
28-
return null;
28+
return select.getPlainSelect().getFromItem().accept(this, context);
2929
}
3030

3131
@Override
3232
public <S> T visit(LateralSubSelect lateralSubSelect, S context) {
33-
34-
return null;
33+
return lateralSubSelect.getPlainSelect().getFromItem().accept(this, context);
3534
}
3635

3736
@Override
@@ -42,31 +41,30 @@ public <S> T visit(TableFunction tableFunction, S context) {
4241

4342
@Override
4443
public <S> T visit(ParenthesedFromItem fromItem, S context) {
45-
46-
return null;
44+
return fromItem.getFromItem().accept(this, context);
4745
}
4846

4947
@Override
5048
public <S> T visit(Values values, S context) {
51-
5249
return null;
5350
}
5451

5552
@Override
5653
public <S> T visit(PlainSelect plainSelect, S context) {
57-
58-
return null;
54+
return plainSelect.getFromItem().accept(this, context);
5955
}
6056

6157
@Override
6258
public <S> T visit(SetOperationList setOperationList, S context) {
63-
64-
return null;
59+
ArrayList<T> results = new ArrayList<>();
60+
for (Select select : setOperationList.getSelects()) {
61+
results.add(select.accept(this, context));
62+
}
63+
return results.isEmpty() ? null : results.get(0);
6564
}
6665

6766
@Override
6867
public <S> T visit(TableStatement tableStatement, S context) {
69-
7068
return null;
7169
}
7270

@@ -77,7 +75,6 @@ public <S> T visit(Import imprt, S context) {
7775
}
7876

7977
public <S> T visit(FromQuery fromQuery, S context) {
80-
81-
return null;
78+
return fromQuery.getFromItem().accept(this, context);
8279
}
8380
}

0 commit comments

Comments
 (0)