forked from alibaba/druid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request alibaba#716 from wenshao/master
improved sql parser for postgresql
- Loading branch information
Showing
17 changed files
with
740 additions
and
1 deletion.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
src/main/java/com/alibaba/druid/sql/dialect/postgresql/ast/expr/PGCidrExpr.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,56 @@ | ||
package com.alibaba.druid.sql.dialect.postgresql.ast.expr; | ||
|
||
import com.alibaba.druid.sql.ast.SQLExpr; | ||
import com.alibaba.druid.sql.dialect.postgresql.visitor.PGASTVisitor; | ||
|
||
public class PGCidrExpr extends PGExprImpl { | ||
|
||
private SQLExpr value; | ||
|
||
public SQLExpr getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(SQLExpr value) { | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public void accept0(PGASTVisitor visitor) { | ||
if (visitor.visit(this)) { | ||
acceptChild(visitor, value); | ||
} | ||
visitor.endVisit(this); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((value == null) ? 0 : value.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (obj == null) { | ||
return false; | ||
} | ||
if (getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
PGCidrExpr other = (PGCidrExpr) obj; | ||
if (value == null) { | ||
if (other.value != null) { | ||
return false; | ||
} | ||
} else if (!value.equals(other.value)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
src/main/java/com/alibaba/druid/sql/dialect/postgresql/ast/expr/PGCircleExpr.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,56 @@ | ||
package com.alibaba.druid.sql.dialect.postgresql.ast.expr; | ||
|
||
import com.alibaba.druid.sql.ast.SQLExpr; | ||
import com.alibaba.druid.sql.dialect.postgresql.visitor.PGASTVisitor; | ||
|
||
public class PGCircleExpr extends PGExprImpl { | ||
|
||
private SQLExpr value; | ||
|
||
public SQLExpr getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(SQLExpr value) { | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public void accept0(PGASTVisitor visitor) { | ||
if (visitor.visit(this)) { | ||
acceptChild(visitor, value); | ||
} | ||
visitor.endVisit(this); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((value == null) ? 0 : value.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (obj == null) { | ||
return false; | ||
} | ||
if (getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
PGCircleExpr other = (PGCircleExpr) obj; | ||
if (value == null) { | ||
if (other.value != null) { | ||
return false; | ||
} | ||
} else if (!value.equals(other.value)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
src/main/java/com/alibaba/druid/sql/dialect/postgresql/ast/expr/PGInetExpr.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,56 @@ | ||
package com.alibaba.druid.sql.dialect.postgresql.ast.expr; | ||
|
||
import com.alibaba.druid.sql.ast.SQLExpr; | ||
import com.alibaba.druid.sql.dialect.postgresql.visitor.PGASTVisitor; | ||
|
||
public class PGInetExpr extends PGExprImpl { | ||
|
||
private SQLExpr value; | ||
|
||
public SQLExpr getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(SQLExpr value) { | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public void accept0(PGASTVisitor visitor) { | ||
if (visitor.visit(this)) { | ||
acceptChild(visitor, value); | ||
} | ||
visitor.endVisit(this); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((value == null) ? 0 : value.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (obj == null) { | ||
return false; | ||
} | ||
if (getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
PGInetExpr other = (PGInetExpr) obj; | ||
if (value == null) { | ||
if (other.value != null) { | ||
return false; | ||
} | ||
} else if (!value.equals(other.value)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
src/main/java/com/alibaba/druid/sql/dialect/postgresql/ast/expr/PGLineSegmentsExpr.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,56 @@ | ||
package com.alibaba.druid.sql.dialect.postgresql.ast.expr; | ||
|
||
import com.alibaba.druid.sql.ast.SQLExpr; | ||
import com.alibaba.druid.sql.dialect.postgresql.visitor.PGASTVisitor; | ||
|
||
public class PGLineSegmentsExpr extends PGExprImpl { | ||
|
||
private SQLExpr value; | ||
|
||
public SQLExpr getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(SQLExpr value) { | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public void accept0(PGASTVisitor visitor) { | ||
if (visitor.visit(this)) { | ||
acceptChild(visitor, value); | ||
} | ||
visitor.endVisit(this); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((value == null) ? 0 : value.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (obj == null) { | ||
return false; | ||
} | ||
if (getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
PGLineSegmentsExpr other = (PGLineSegmentsExpr) obj; | ||
if (value == null) { | ||
if (other.value != null) { | ||
return false; | ||
} | ||
} else if (!value.equals(other.value)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
} |
58 changes: 58 additions & 0 deletions
58
src/main/java/com/alibaba/druid/sql/dialect/postgresql/ast/expr/PGMacAddrExpr.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,58 @@ | ||
package com.alibaba.druid.sql.dialect.postgresql.ast.expr; | ||
|
||
import com.alibaba.druid.sql.ast.SQLExpr; | ||
import com.alibaba.druid.sql.dialect.postgresql.visitor.PGASTVisitor; | ||
|
||
|
||
public class PGMacAddrExpr extends PGExprImpl { | ||
|
||
private SQLExpr value; | ||
|
||
public SQLExpr getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(SQLExpr value) { | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public void accept0(PGASTVisitor visitor) { | ||
if (visitor.visit(this)) { | ||
acceptChild(visitor, value); | ||
} | ||
visitor.endVisit(this); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((value == null) ? 0 : value.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (obj == null) { | ||
return false; | ||
} | ||
if (getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
PGMacAddrExpr other = (PGMacAddrExpr) obj; | ||
if (value == null) { | ||
if (other.value != null) { | ||
return false; | ||
} | ||
} else if (!value.equals(other.value)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
} | ||
|
58 changes: 58 additions & 0 deletions
58
src/main/java/com/alibaba/druid/sql/dialect/postgresql/ast/expr/PGPolygonExpr.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,58 @@ | ||
package com.alibaba.druid.sql.dialect.postgresql.ast.expr; | ||
|
||
import com.alibaba.druid.sql.ast.SQLExpr; | ||
import com.alibaba.druid.sql.dialect.postgresql.visitor.PGASTVisitor; | ||
|
||
|
||
public class PGPolygonExpr extends PGExprImpl { | ||
|
||
private SQLExpr value; | ||
|
||
public SQLExpr getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(SQLExpr value) { | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public void accept0(PGASTVisitor visitor) { | ||
if (visitor.visit(this)) { | ||
acceptChild(visitor, value); | ||
} | ||
visitor.endVisit(this); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((value == null) ? 0 : value.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (obj == null) { | ||
return false; | ||
} | ||
if (getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
PGPolygonExpr other = (PGPolygonExpr) obj; | ||
if (value == null) { | ||
if (other.value != null) { | ||
return false; | ||
} | ||
} else if (!value.equals(other.value)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
} | ||
|
Oops, something went wrong.