mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
@@ -189,8 +189,12 @@ public class TableStat {
|
||||
private final long hashCode64;
|
||||
|
||||
public Name(String name){
|
||||
this(name, FnvHash.hashCode64(name));
|
||||
}
|
||||
|
||||
public Name(String name, long hashCode64){
|
||||
this.name = name;
|
||||
hashCode64 = FnvHash.hashCode64(name);
|
||||
this.hashCode64 = hashCode64;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
@@ -225,34 +229,24 @@ public class TableStat {
|
||||
private Column right;
|
||||
private String operator;
|
||||
|
||||
public Relationship(){
|
||||
|
||||
public Relationship(Column left, Column right, String operator) {
|
||||
this.left = left;
|
||||
this.right = right;
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
public Column getLeft() {
|
||||
return left;
|
||||
}
|
||||
|
||||
public void setLeft(Column left) {
|
||||
this.left = left;
|
||||
}
|
||||
|
||||
public Column getRight() {
|
||||
return right;
|
||||
}
|
||||
|
||||
public void setRight(Column right) {
|
||||
this.right = right;
|
||||
}
|
||||
|
||||
public String getOperator() {
|
||||
return operator;
|
||||
}
|
||||
|
||||
public void setOperator(String operator) {
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
@@ -308,27 +302,23 @@ public class TableStat {
|
||||
|
||||
public static class Condition {
|
||||
|
||||
private Column column;
|
||||
private String operator;
|
||||
private final Column column;
|
||||
private final String operator;
|
||||
private final List<Object> values = new ArrayList<Object>();
|
||||
|
||||
private List<Object> values = new ArrayList<Object>();
|
||||
public Condition(Column column, String operator) {
|
||||
this.column = column;
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
public Column getColumn() {
|
||||
return column;
|
||||
}
|
||||
|
||||
public void setColumn(Column column) {
|
||||
this.column = column;
|
||||
}
|
||||
|
||||
public String getOperator() {
|
||||
return operator;
|
||||
}
|
||||
|
||||
public void setOperator(String operator) {
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
public List<Object> getValues() {
|
||||
return values;
|
||||
}
|
||||
@@ -440,6 +430,12 @@ public class TableStat {
|
||||
}
|
||||
}
|
||||
|
||||
public Column(String table, String name, long hashCode64){
|
||||
this.table = table;
|
||||
this.name = name;
|
||||
this.hashCode64 = hashCode64;
|
||||
}
|
||||
|
||||
public String getTable() {
|
||||
return table;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user