Skip to content

Commit bce1290

Browse files
committed
- removed deprecated union class (replaced by SetOperationList)
1 parent 673eb25 commit bce1290

File tree

9 files changed

+7
-187
lines changed

9 files changed

+7
-187
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
public interface SelectVisitor {
2626
public void visit(PlainSelect plainSelect);
27-
28-
public void visit(Union union);
2927

3028
public void visit(SetOperationList setOpList);
3129
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import net.sf.jsqlparser.statement.select.SetOperationList.SetOperationType;
44

55
/**
6-
* Einzelne Set-Operation. Diese geben nur noch den einzelnen Operationsnamen aus.
7-
* Durch die SetOperationList wird alles zusammengehalten.
6+
* Single Set-Operation (name). Placeholder for one specific set operation, e.g.
7+
* union, intersect.
88
* @author tw
99
*/
1010
public abstract class SetOperation {

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

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,13 @@
1-
/* ================================================================
2-
* JSQLParser : java based sql parser
3-
* ================================================================
4-
*
5-
* Project Info: http://jsqlparser.sourceforge.net
6-
* Project Lead: Leonardo Francalanci (leoonardoo@yahoo.it);
7-
*
8-
* (C) Copyright 2004, by Leonardo Francalanci
9-
*
10-
* This library is free software; you can redistribute it and/or modify it under the terms
11-
* of the GNU Lesser General Public License as published by the Free Software Foundation;
12-
* either version 2.1 of the License, or (at your option) any later version.
13-
*
14-
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16-
* See the GNU Lesser General Public License for more details.
17-
*
18-
* You should have received a copy of the GNU Lesser General Public License along with this
19-
* library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20-
* Boston, MA 02111-1307, USA.
21-
*/
221
package net.sf.jsqlparser.statement.select;
232

243
import java.util.ArrayList;
254
import java.util.List;
265

276
/**
28-
* Eine Set Operation. Diese besteht aus einer Liste von plainSelects verknüpft
29-
* mit Set-Operationen (UNION,INTERSECT,MINUS,EXCEPT). Diese Operationen haben
30-
* die gleiche Priorität, s.d. die Datenbanken dies von Links nach rechts
31-
* abarbeiten.
32-
*
7+
* A database set operation. This operation consists of a list of plainSelects
8+
* connected by set operations (UNION,INTERSECT,MINUS,EXCEPT). All these operations
9+
* have the same priority.
10+
* @author tw
3311
*/
3412
public class SetOperationList implements SelectBody {
3513

@@ -47,11 +25,6 @@ public List getOrderByElements() {
4725
return orderByElements;
4826
}
4927

50-
/**
51-
* the list of {@link PlainSelect}s in this SetOperationList
52-
*
53-
* @return the list of {@link PlainSelect}s
54-
*/
5528
public List getPlainSelects() {
5629
return plainSelects;
5730
}
@@ -102,7 +75,7 @@ public String toString() {
10275
}
10376

10477
/**
105-
* Unterstützte Set-Operationen.
78+
* list of set operations.
10679
*/
10780
public enum SetOperationType {
10881

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

Lines changed: 0 additions & 111 deletions
This file was deleted.

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/*
2-
* To change this template, choose Tools | Templates
3-
* and open the template in the editor.
4-
*/
51
package net.sf.jsqlparser.statement.select;
62

73
import net.sf.jsqlparser.statement.select.SetOperationList.SetOperationType;

src/main/java/net/sf/jsqlparser/util/deparser/SelectDeParser.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import net.sf.jsqlparser.statement.select.SubJoin;
2525
import net.sf.jsqlparser.statement.select.SubSelect;
2626
import net.sf.jsqlparser.statement.select.Top;
27-
import net.sf.jsqlparser.statement.select.Union;
2827

2928
/**
3029
* A class to de-parse (that is, tranform from JSqlParser hierarchy into a string) a
@@ -121,31 +120,6 @@ public void visit(PlainSelect plainSelect) {
121120

122121
}
123122

124-
public void visit(Union union) {
125-
for (Iterator<PlainSelect> iter = union.getPlainSelects().iterator(); iter.hasNext();) {
126-
buffer.append("(");
127-
PlainSelect plainSelect = iter.next();
128-
plainSelect.accept(this);
129-
buffer.append(")");
130-
if (iter.hasNext()) {
131-
buffer.append(" UNION ");
132-
if (union.isAll()) {
133-
buffer.append("ALL ");// should UNION be a BinaryExpression ?
134-
}
135-
}
136-
137-
}
138-
139-
if (union.getOrderByElements() != null) {
140-
deparseOrderBy(union.getOrderByElements());
141-
}
142-
143-
if (union.getLimit() != null) {
144-
deparseLimit(union.getLimit());
145-
}
146-
147-
}
148-
149123
public void visit(OrderByElement orderBy) {
150124
orderBy.getExpression().accept(expressionVisitor);
151125
if (!orderBy.isAsc())

src/main/javacc/net/sf/jsqlparser/parser/JSqlParserCC.jj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ import net.sf.jsqlparser.statement.select.SelectExpressionItem;
127127
import net.sf.jsqlparser.statement.select.SelectItem;
128128
import net.sf.jsqlparser.statement.select.SubSelect;
129129
import net.sf.jsqlparser.statement.select.Top;
130-
import net.sf.jsqlparser.statement.select.Union;
131130
import net.sf.jsqlparser.statement.select.SetOperationList;
132131
import net.sf.jsqlparser.statement.select.UnionOp;
133132
import net.sf.jsqlparser.statement.select.MinusOp;

src/test/java/net/sf/jsqlparser/test/select/SelectTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import net.sf.jsqlparser.statement.select.Select;
2929
import net.sf.jsqlparser.statement.select.SelectExpressionItem;
3030
import net.sf.jsqlparser.statement.select.SetOperationList;
31-
import net.sf.jsqlparser.statement.select.Union;
3231
import net.sf.jsqlparser.util.deparser.ExpressionDeParser;
3332
import net.sf.jsqlparser.util.deparser.SelectDeParser;
3433
import net.sf.jsqlparser.util.deparser.StatementDeParser;

src/test/java/net/sf/jsqlparser/test/tablesfinder/TablesNamesFinder.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
import net.sf.jsqlparser.statement.select.SetOperationList;
6060
import net.sf.jsqlparser.statement.select.SubJoin;
6161
import net.sf.jsqlparser.statement.select.SubSelect;
62-
import net.sf.jsqlparser.statement.select.Union;
6362

6463
public class TablesNamesFinder implements SelectVisitor, FromItemVisitor, ExpressionVisitor, ItemsListVisitor {
6564
private List tables;
@@ -84,13 +83,6 @@ public void visit(PlainSelect plainSelect) {
8483

8584
}
8685

87-
public void visit(Union union) {
88-
for (Iterator iter = union.getPlainSelects().iterator(); iter.hasNext();) {
89-
PlainSelect plainSelect = (PlainSelect) iter.next();
90-
visit(plainSelect);
91-
}
92-
}
93-
9486
public void visit(Table tableName) {
9587
String tableWholeName = tableName.getWholeTableName();
9688
tables.add(tableWholeName);

0 commit comments

Comments
 (0)