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 4848import net .sf .jsqlparser .expression .operators .relational .NotEqualsTo ;
4949import net .sf .jsqlparser .expression .operators .relational .RegExpMatchOperator ;
5050import 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 ;
5153import net .sf .jsqlparser .expression .operators .relational .JsonOperator ;
5254import net .sf .jsqlparser .schema .Column ;
5355import net .sf .jsqlparser .statement .select .SubSelect ;
@@ -180,4 +182,8 @@ public interface ExpressionVisitor {
180182
181183 public void visit (NotExpression aThis );
182184
185+ public void visit (TSQLLeftJoin tsqlLeftJoin );
186+
187+ public void visit (TSQLRightJoin tsqlRightJoin );
188+
183189}
Original file line number Diff line number Diff line change 2424import net .sf .jsqlparser .expression .operators .arithmetic .*;
2525import net .sf .jsqlparser .expression .operators .conditional .AndExpression ;
2626import net .sf .jsqlparser .expression .operators .conditional .OrExpression ;
27- import net .sf .jsqlparser .expression .operators .relational .JsonOperator ;
2827import net .sf .jsqlparser .expression .operators .relational .*;
2928import net .sf .jsqlparser .schema .Column ;
3029import net .sf .jsqlparser .statement .select .AllColumns ;
@@ -508,4 +507,14 @@ public void visit(DateTimeLiteralExpression literal) {
508507
509508 }
510509
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+
511520}
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 9191import net .sf .jsqlparser .expression .operators .relational .NotEqualsTo ;
9292import net .sf .jsqlparser .expression .operators .relational .RegExpMatchOperator ;
9393import 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 ;
9496import net .sf .jsqlparser .schema .Column ;
9597import net .sf .jsqlparser .schema .Table ;
9698import net .sf .jsqlparser .statement .Block ;
@@ -859,4 +861,14 @@ public void visit(DescribeStatement describe) {
859861 public void visit (ExplainStatement explain ) {
860862 explain .getStatement ().accept (this );
861863 }
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+ }
862874}
Original file line number Diff line number Diff line change 9494import net .sf .jsqlparser .expression .operators .relational .RegExpMatchOperator ;
9595import net .sf .jsqlparser .expression .operators .relational .RegExpMySQLOperator ;
9696import 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 ;
9799import net .sf .jsqlparser .schema .Column ;
98100import net .sf .jsqlparser .schema .Table ;
99101import net .sf .jsqlparser .statement .select .OrderByElement ;
@@ -812,4 +814,14 @@ public void visit(DateTimeLiteralExpression literal) {
812814 buffer .append (literal .toString ());
813815 }
814816
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+
815827}
Original file line number Diff line number Diff line change @@ -2182,6 +2182,8 @@ Expression RegularCondition() #RegularCondition:
21822182 ">" { result = new GreaterThan(); }
21832183 | "<" { result = new MinorThan(); }
21842184 | "=" { result = new EqualsTo(); }
2185+ | "*=" { result = new TSQLLeftJoin(); }
2186+ | "=*" { result = new TSQLRightJoin(); }
21852187 | token=<OP_GREATERTHANEQUALS> { result = new GreaterThanEquals(token.image); }
21862188 | token=<OP_MINORTHANEQUALS> { result = new MinorThanEquals(token.image); }
21872189 | 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 {
18101810 assertSqlCanBeParsedAndDeparsed (statement );
18111811 }
18121812
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+
18131825 @ Test
18141826 public void testOracleJoin () throws JSQLParserException {
18151827 String stmt = "SELECT * FROM tabelle1, tabelle2 WHERE tabelle1.a = tabelle2.b(+)" ;
18161828 assertSqlCanBeParsedAndDeparsed (stmt );
18171829 }
1818-
1830+
18191831 @ Test
18201832 public void testOracleJoin2 () throws JSQLParserException {
18211833 String stmt = "SELECT * FROM tabelle1, tabelle2 WHERE tabelle1.a(+) = tabelle2.b" ;
You can’t perform that action at this time.
0 commit comments