mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
添加SQL统计功能,统计SQL中所使用的表和字段
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@274 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -22,7 +22,6 @@ public class TableStat {
|
||||
public int getUpdateCount() {
|
||||
return updateCount;
|
||||
}
|
||||
|
||||
|
||||
public void incrementUpdateCount() {
|
||||
updateCount++;
|
||||
@@ -35,7 +34,7 @@ public class TableStat {
|
||||
public int getDeleteCount() {
|
||||
return deleteCount;
|
||||
}
|
||||
|
||||
|
||||
public void incrementDeleteCount() {
|
||||
this.deleteCount++;
|
||||
}
|
||||
@@ -43,7 +42,7 @@ public class TableStat {
|
||||
public void setDeleteCount(int deleteCount) {
|
||||
this.deleteCount = deleteCount;
|
||||
}
|
||||
|
||||
|
||||
public void incrementInsertCount() {
|
||||
this.insertCount++;
|
||||
}
|
||||
@@ -74,6 +73,37 @@ public class TableStat {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public static class Name {
|
||||
|
||||
private String name;
|
||||
|
||||
public Name(String name){
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.name.toLowerCase().hashCode();
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (!(o instanceof Name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Name other = (Name) o;
|
||||
|
||||
return this.name.equalsIgnoreCase(other.name);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Column {
|
||||
|
||||
private String table;
|
||||
|
||||
Reference in New Issue
Block a user