File tree Expand file tree Collapse file tree 3 files changed +26
-20
lines changed
src/main/java/net/sf/jsqlparser Expand file tree Collapse file tree 3 files changed +26
-20
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,24 @@ public String toString() {
8989 b .append ("*" );
9090 }
9191 b .append (") OVER (" );
92+
93+ toStringPartitionBy (b );
94+ toStringOrderByElements (b );
95+
96+ b .append (")" );
97+
98+ return b .toString ();
99+ }
100+
101+ public boolean isAllColumns () {
102+ return allColumns ;
103+ }
104+
105+ public void setAllColumns (boolean allColumns ) {
106+ this .allColumns = allColumns ;
107+ }
108+
109+ private void toStringPartitionBy (StringBuilder b ) {
92110 if (partitionByColumns != null && !partitionByColumns .isEmpty ()) {
93111 b .append ("PARTITION BY " );
94112 for (int i = 0 ; i < partitionByColumns .size (); i ++) {
@@ -99,7 +117,9 @@ public String toString() {
99117 }
100118 b .append (" " );
101119 }
120+ }
102121
122+ private void toStringOrderByElements (StringBuilder b ) {
103123 if (orderByElements != null && !orderByElements .isEmpty ()) {
104124 b .append ("ORDER BY " );
105125 for (int i = 0 ; i < orderByElements .size (); i ++) {
@@ -109,17 +129,5 @@ public String toString() {
109129 b .append (orderByElements .get (i ).toString ());
110130 }
111131 }
112-
113- b .append (")" );
114-
115- return b .toString ();
116- }
117-
118- public boolean isAllColumns () {
119- return allColumns ;
120- }
121-
122- public void setAllColumns (boolean allColumns ) {
123- this .allColumns = allColumns ;
124132 }
125133}
Original file line number Diff line number Diff line change @@ -51,10 +51,9 @@ public List<ExpressionList> getExprList() {
5151 }
5252
5353 public void addExpressionList (ExpressionList el ) {
54- if (!exprList .isEmpty ()) {
55- if (exprList .get (0 ).getExpressions ().size () != el .getExpressions ().size ()) {
56- throw new IllegalArgumentException ("different count of parameters" );
57- }
54+ if (!exprList .isEmpty ()
55+ && exprList .get (0 ).getExpressions ().size () != el .getExpressions ().size ()) {
56+ throw new IllegalArgumentException ("different count of parameters" );
5857 }
5958 exprList .add (el );
6059 }
Original file line number Diff line number Diff line change @@ -227,10 +227,9 @@ public void visit(PlainSelect plainSelect) {
227227 @ Override
228228 public void visit (Table tableName ) {
229229 String tableWholeName = tableName .getWholeTableName ();
230- if (!otherItemNames .contains (tableWholeName .toLowerCase ())) {
231- if (!tables .contains (tableWholeName )) {
232- tables .add (tableWholeName );
233- }
230+ if (!otherItemNames .contains (tableWholeName .toLowerCase ())
231+ && !tables .contains (tableWholeName )) {
232+ tables .add (tableWholeName );
234233 }
235234 }
236235
You can’t perform that action at this time.
0 commit comments