-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature parsing inserts/updates/delete within CTEs
- Loading branch information
Showing
35 changed files
with
1,206 additions
and
170 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
31 changes: 31 additions & 0 deletions
31
src/main/java/net/sf/jsqlparser/statement/ParenthesedStatement.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,31 @@ | ||
/*- | ||
* #%L | ||
* JSQLParser library | ||
* %% | ||
* Copyright (C) 2004 - 2019 JSQLParser | ||
* %% | ||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0 | ||
* #L% | ||
*/ | ||
package net.sf.jsqlparser.statement; | ||
|
||
import net.sf.jsqlparser.expression.Alias; | ||
|
||
public interface ParenthesedStatement extends Statement { | ||
|
||
<T, S> T accept(StatementVisitor<T> statementVisitor, S context); | ||
|
||
default void accept(StatementVisitor<?> statementVisitor) { | ||
this.accept(statementVisitor, null); | ||
} | ||
|
||
Alias getAlias(); | ||
|
||
void setAlias(Alias alias); | ||
|
||
default ParenthesedStatement withAlias(Alias alias) { | ||
setAlias(alias); | ||
return this; | ||
} | ||
|
||
} |
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
64 changes: 64 additions & 0 deletions
64
src/main/java/net/sf/jsqlparser/statement/delete/ParenthesedDelete.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,64 @@ | ||
/*- | ||
* #%L | ||
* JSQLParser library | ||
* %% | ||
* Copyright (C) 2004 - 2023 JSQLParser | ||
* %% | ||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0 | ||
* #L% | ||
*/ | ||
package net.sf.jsqlparser.statement.delete; | ||
|
||
import net.sf.jsqlparser.expression.Alias; | ||
import net.sf.jsqlparser.statement.ParenthesedStatement; | ||
import net.sf.jsqlparser.statement.StatementVisitor; | ||
|
||
public class ParenthesedDelete extends Delete implements ParenthesedStatement { | ||
|
||
Alias alias; | ||
Delete delete; | ||
|
||
public ParenthesedDelete() {} | ||
|
||
@Override | ||
public Alias getAlias() { | ||
return alias; | ||
} | ||
|
||
@Override | ||
public void setAlias(Alias alias) { | ||
this.alias = alias; | ||
} | ||
|
||
public ParenthesedDelete withAlias(Alias alias) { | ||
this.setAlias(alias); | ||
return this; | ||
} | ||
|
||
public Delete getDelete() { | ||
return delete; | ||
} | ||
|
||
public void setDelete(Delete delete) { | ||
this.delete = delete; | ||
} | ||
|
||
public ParenthesedDelete withDelete(Delete delete) { | ||
setDelete(delete); | ||
return this; | ||
} | ||
|
||
public String toString() { | ||
StringBuilder builder = new StringBuilder(); | ||
builder.append("(").append(delete).append(")"); | ||
if (alias != null) { | ||
builder.append(alias); | ||
} | ||
return builder.toString(); | ||
} | ||
|
||
@Override | ||
public <T, S> T accept(StatementVisitor<T> statementVisitor, S context) { | ||
return statementVisitor.visit(this, context); | ||
} | ||
} |
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
63 changes: 63 additions & 0 deletions
63
src/main/java/net/sf/jsqlparser/statement/insert/ParenthesedInsert.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,63 @@ | ||
/*- | ||
* #%L | ||
* JSQLParser library | ||
* %% | ||
* Copyright (C) 2004 - 2023 JSQLParser | ||
* %% | ||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0 | ||
* #L% | ||
*/ | ||
package net.sf.jsqlparser.statement.insert; | ||
|
||
import net.sf.jsqlparser.expression.Alias; | ||
import net.sf.jsqlparser.statement.ParenthesedStatement; | ||
import net.sf.jsqlparser.statement.StatementVisitor; | ||
|
||
public class ParenthesedInsert extends Insert implements ParenthesedStatement { | ||
Alias alias; | ||
Insert insert; | ||
|
||
public ParenthesedInsert() {} | ||
|
||
@Override | ||
public Alias getAlias() { | ||
return alias; | ||
} | ||
|
||
@Override | ||
public void setAlias(Alias alias) { | ||
this.alias = alias; | ||
} | ||
|
||
public ParenthesedInsert withAlias(Alias alias) { | ||
this.setAlias(alias); | ||
return this; | ||
} | ||
|
||
public Insert getInsert() { | ||
return insert; | ||
} | ||
|
||
public void setInsert(Insert insert) { | ||
this.insert = insert; | ||
} | ||
|
||
public ParenthesedInsert withInsert(Insert insert) { | ||
setInsert(insert); | ||
return this; | ||
} | ||
|
||
public String toString() { | ||
StringBuilder builder = new StringBuilder(); | ||
builder.append("(").append(insert).append(")"); | ||
if (alias != null) { | ||
builder.append(alias); | ||
} | ||
return builder.toString(); | ||
} | ||
|
||
@Override | ||
public <T, S> T accept(StatementVisitor<T> statementVisitor, S context) { | ||
return statementVisitor.visit(this, context); | ||
} | ||
} |
Oops, something went wrong.