mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add testcase & remove unused code
This commit is contained in:
@@ -54,4 +54,25 @@ public class SQLExprTableSource extends SQLTableSourceImpl {
|
||||
public void output(StringBuffer buf) {
|
||||
this.expr.output(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((expr == null) ? 0 : expr.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;
|
||||
SQLExprTableSource other = (SQLExprTableSource) obj;
|
||||
if (expr == null) {
|
||||
if (other.expr != null) return false;
|
||||
} else if (!expr.equals(other.expr)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.ast.statement;
|
||||
|
||||
|
||||
public class SQLIndexDefinition {
|
||||
|
||||
}
|
||||
@@ -29,15 +29,15 @@ public class SQLSelectItem extends SQLObjectImpl {
|
||||
public SQLSelectItem(){
|
||||
|
||||
}
|
||||
|
||||
public SQLSelectItem(SQLExpr expr) {
|
||||
|
||||
public SQLSelectItem(SQLExpr expr){
|
||||
this(expr, null);
|
||||
}
|
||||
|
||||
public SQLSelectItem(SQLExpr expr, String alias){
|
||||
this.expr = expr;
|
||||
this.alias = alias;
|
||||
|
||||
|
||||
if (expr != null) {
|
||||
expr.setParent(this);
|
||||
}
|
||||
@@ -76,4 +76,29 @@ public class SQLSelectItem extends SQLObjectImpl {
|
||||
}
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((alias == null) ? 0 : alias.hashCode());
|
||||
result = prime * result + ((expr == null) ? 0 : expr.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;
|
||||
SQLSelectItem other = (SQLSelectItem) obj;
|
||||
if (alias == null) {
|
||||
if (other.alias != null) return false;
|
||||
} else if (!alias.equals(other.alias)) return false;
|
||||
if (expr == null) {
|
||||
if (other.expr != null) return false;
|
||||
} else if (!expr.equals(other.expr)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -63,4 +63,31 @@ public class SQLSelectOrderByItem extends SQLObjectImpl {
|
||||
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((collate == null) ? 0 : collate.hashCode());
|
||||
result = prime * result + ((expr == null) ? 0 : expr.hashCode());
|
||||
result = prime * result + ((type == null) ? 0 : type.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;
|
||||
SQLSelectOrderByItem other = (SQLSelectOrderByItem) obj;
|
||||
if (collate == null) {
|
||||
if (other.collate != null) return false;
|
||||
} else if (!collate.equals(other.collate)) return false;
|
||||
if (expr == null) {
|
||||
if (other.expr != null) return false;
|
||||
} else if (!expr.equals(other.expr)) return false;
|
||||
if (type != other.type) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.ast.statement;
|
||||
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class SQLTableConstaintImpl extends SQLConstaintImpl implements SQLTableConstaint {
|
||||
|
||||
public SQLTableConstaintImpl(){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user