File tree Expand file tree Collapse file tree 8 files changed +127
-2
lines changed
jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/select Expand file tree Collapse file tree 8 files changed +127
-2
lines changed Original file line number Diff line number Diff line change 48
48
import net .sf .jsqlparser .expression .operators .relational .NotEqualsTo ;
49
49
import net .sf .jsqlparser .expression .operators .relational .RegExpMatchOperator ;
50
50
import net .sf .jsqlparser .expression .operators .relational .RegExpMySQLOperator ;
51
+ import net .sf .jsqlparser .expression .operators .relational .TSQLLeftJoin ;
52
+ import net .sf .jsqlparser .expression .operators .relational .TSQLRightJoin ;
51
53
import net .sf .jsqlparser .expression .operators .relational .JsonOperator ;
52
54
import net .sf .jsqlparser .schema .Column ;
53
55
import net .sf .jsqlparser .statement .select .SubSelect ;
@@ -180,4 +182,8 @@ public interface ExpressionVisitor {
180
182
181
183
public void visit (NotExpression aThis );
182
184
185
+ public void visit (TSQLLeftJoin tsqlLeftJoin );
186
+
187
+ public void visit (TSQLRightJoin tsqlRightJoin );
188
+
183
189
}
Original file line number Diff line number Diff line change 24
24
import net .sf .jsqlparser .expression .operators .arithmetic .*;
25
25
import net .sf .jsqlparser .expression .operators .conditional .AndExpression ;
26
26
import net .sf .jsqlparser .expression .operators .conditional .OrExpression ;
27
- import net .sf .jsqlparser .expression .operators .relational .JsonOperator ;
28
27
import net .sf .jsqlparser .expression .operators .relational .*;
29
28
import net .sf .jsqlparser .schema .Column ;
30
29
import net .sf .jsqlparser .statement .select .AllColumns ;
@@ -508,4 +507,14 @@ public void visit(DateTimeLiteralExpression literal) {
508
507
509
508
}
510
509
510
+ @ Override
511
+ public void visit (TSQLLeftJoin tsqlLeftJoin ) {
512
+ visitBinaryExpression (tsqlLeftJoin );
513
+ }
514
+
515
+ @ Override
516
+ public void visit (TSQLRightJoin tsqlRightJoin ) {
517
+ visitBinaryExpression (tsqlRightJoin );
518
+ }
519
+
511
520
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ * #%L
3
+ * JSQLParser library
4
+ * %%
5
+ * Copyright (C) 2004 - 2013 JSQLParser
6
+ * %%
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as
9
+ * published by the Free Software Foundation, either version 2.1 of the
10
+ * License, or (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Lesser Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Lesser Public
18
+ * License along with this program. If not, see
19
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>.
20
+ * #L%
21
+ */
22
+ package net .sf .jsqlparser .expression .operators .relational ;
23
+
24
+ import net .sf .jsqlparser .expression .ExpressionVisitor ;
25
+
26
+ public class TSQLLeftJoin extends ComparisonOperator {
27
+
28
+ public TSQLLeftJoin () {
29
+ super ("*=" );
30
+ }
31
+
32
+ @ Override
33
+ public void accept (ExpressionVisitor expressionVisitor ) {
34
+ expressionVisitor .visit (this );
35
+ }
36
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * #%L
3
+ * JSQLParser library
4
+ * %%
5
+ * Copyright (C) 2004 - 2013 JSQLParser
6
+ * %%
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as
9
+ * published by the Free Software Foundation, either version 2.1 of the
10
+ * License, or (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Lesser Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Lesser Public
18
+ * License along with this program. If not, see
19
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>.
20
+ * #L%
21
+ */
22
+ package net .sf .jsqlparser .expression .operators .relational ;
23
+
24
+ import net .sf .jsqlparser .expression .ExpressionVisitor ;
25
+
26
+ public class TSQLRightJoin extends ComparisonOperator {
27
+
28
+ public TSQLRightJoin () {
29
+ super ("=*" );
30
+ }
31
+
32
+ @ Override
33
+ public void accept (ExpressionVisitor expressionVisitor ) {
34
+ expressionVisitor .visit (this );
35
+ }
36
+ }
Original file line number Diff line number Diff line change 91
91
import net .sf .jsqlparser .expression .operators .relational .NotEqualsTo ;
92
92
import net .sf .jsqlparser .expression .operators .relational .RegExpMatchOperator ;
93
93
import net .sf .jsqlparser .expression .operators .relational .RegExpMySQLOperator ;
94
+ import net .sf .jsqlparser .expression .operators .relational .TSQLLeftJoin ;
95
+ import net .sf .jsqlparser .expression .operators .relational .TSQLRightJoin ;
94
96
import net .sf .jsqlparser .schema .Column ;
95
97
import net .sf .jsqlparser .schema .Table ;
96
98
import net .sf .jsqlparser .statement .Block ;
@@ -859,4 +861,14 @@ public void visit(DescribeStatement describe) {
859
861
public void visit (ExplainStatement explain ) {
860
862
explain .getStatement ().accept (this );
861
863
}
864
+
865
+ @ Override
866
+ public void visit (TSQLLeftJoin tsqlLeftJoin ) {
867
+ visitBinaryExpression (tsqlLeftJoin );
868
+ }
869
+
870
+ @ Override
871
+ public void visit (TSQLRightJoin tsqlRightJoin ) {
872
+ visitBinaryExpression (tsqlRightJoin );
873
+ }
862
874
}
Original file line number Diff line number Diff line change 94
94
import net .sf .jsqlparser .expression .operators .relational .RegExpMatchOperator ;
95
95
import net .sf .jsqlparser .expression .operators .relational .RegExpMySQLOperator ;
96
96
import net .sf .jsqlparser .expression .operators .relational .SupportsOldOracleJoinSyntax ;
97
+ import net .sf .jsqlparser .expression .operators .relational .TSQLLeftJoin ;
98
+ import net .sf .jsqlparser .expression .operators .relational .TSQLRightJoin ;
97
99
import net .sf .jsqlparser .schema .Column ;
98
100
import net .sf .jsqlparser .schema .Table ;
99
101
import net .sf .jsqlparser .statement .select .OrderByElement ;
@@ -812,4 +814,14 @@ public void visit(DateTimeLiteralExpression literal) {
812
814
buffer .append (literal .toString ());
813
815
}
814
816
817
+ @ Override
818
+ public void visit (TSQLLeftJoin tsqlLeftJoin ) {
819
+ visitBinaryExpression (tsqlLeftJoin , " *= " );
820
+ }
821
+
822
+ @ Override
823
+ public void visit (TSQLRightJoin tsqlRightJoin ) {
824
+ visitBinaryExpression (tsqlRightJoin , " =* " );
825
+ }
826
+
815
827
}
Original file line number Diff line number Diff line change @@ -2182,6 +2182,8 @@ Expression RegularCondition() #RegularCondition:
2182
2182
">" { result = new GreaterThan(); }
2183
2183
| "<" { result = new MinorThan(); }
2184
2184
| "=" { result = new EqualsTo(); }
2185
+ | "*=" { result = new TSQLLeftJoin(); }
2186
+ | "=*" { result = new TSQLRightJoin(); }
2185
2187
| token=<OP_GREATERTHANEQUALS> { result = new GreaterThanEquals(token.image); }
2186
2188
| token=<OP_MINORTHANEQUALS> { result = new MinorThanEquals(token.image); }
2187
2189
| token=<OP_NOTEQUALSSTANDARD> { result = new NotEqualsTo(token.image); }
Original file line number Diff line number Diff line change @@ -1810,12 +1810,24 @@ public void testFunctionRight() throws JSQLParserException {
1810
1810
assertSqlCanBeParsedAndDeparsed (statement );
1811
1811
}
1812
1812
1813
+ @ Test
1814
+ public void testTSQLJoin () throws JSQLParserException {
1815
+ String stmt = "SELECT * FROM tabelle1, tabelle2 WHERE tabelle1.a *= tabelle2.b" ;
1816
+ assertSqlCanBeParsedAndDeparsed (stmt );
1817
+ }
1818
+
1819
+ @ Test
1820
+ public void testTSQLJoin2 () throws JSQLParserException {
1821
+ String stmt = "SELECT * FROM tabelle1, tabelle2 WHERE tabelle1.a =* tabelle2.b" ;
1822
+ assertSqlCanBeParsedAndDeparsed (stmt );
1823
+ }
1824
+
1813
1825
@ Test
1814
1826
public void testOracleJoin () throws JSQLParserException {
1815
1827
String stmt = "SELECT * FROM tabelle1, tabelle2 WHERE tabelle1.a = tabelle2.b(+)" ;
1816
1828
assertSqlCanBeParsedAndDeparsed (stmt );
1817
1829
}
1818
-
1830
+
1819
1831
@ Test
1820
1832
public void testOracleJoin2 () throws JSQLParserException {
1821
1833
String stmt = "SELECT * FROM tabelle1, tabelle2 WHERE tabelle1.a(+) = tabelle2.b" ;
You can’t perform that action at this time.
0 commit comments