-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge oracle hierarchical syntax into main
- Loading branch information
Showing
11 changed files
with
209 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
src/main/java/net/sf/jsqlparser/expression/OracleHierarchicalExpression.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* #%L | ||
* JSQLParser library | ||
* %% | ||
* Copyright (C) 2004 - 2013 JSQLParser | ||
* %% | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation, either version 2.1 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Lesser Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Lesser Public | ||
* License along with this program. If not, see | ||
* <http://www.gnu.org/licenses/lgpl-2.1.html>. | ||
* #L% | ||
*/ | ||
package net.sf.jsqlparser.expression; | ||
|
||
/** | ||
* | ||
* @author toben | ||
*/ | ||
public class OracleHierarchicalExpression implements Expression { | ||
|
||
private Expression startExpression; | ||
private Expression connectExpression; | ||
private boolean noCycle = false; | ||
|
||
public Expression getStartExpression() { | ||
return startExpression; | ||
} | ||
|
||
public void setStartExpression(Expression startExpression) { | ||
this.startExpression = startExpression; | ||
} | ||
|
||
public Expression getConnectExpression() { | ||
return connectExpression; | ||
} | ||
|
||
public void setConnectExpression(Expression connectExpression) { | ||
this.connectExpression = connectExpression; | ||
} | ||
|
||
public boolean isNoCycle() { | ||
return noCycle; | ||
} | ||
|
||
public void setNoCycle(boolean noCycle) { | ||
this.noCycle = noCycle; | ||
} | ||
|
||
@Override | ||
public void accept(ExpressionVisitor expressionVisitor) { | ||
expressionVisitor.visit(this); | ||
} | ||
|
||
public String toString() { | ||
StringBuilder b = new StringBuilder(); | ||
if (startExpression != null) { | ||
b.append(" START WITH ").append(startExpression.toString()); | ||
} | ||
b.append(" CONNECT BY "); | ||
if (isNoCycle()) { | ||
b.append("NOCYCLE "); | ||
} | ||
b.append(connectExpression.toString()); | ||
return b.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.