/** * Alipay.com Inc. * Copyright (c) 2004-2012 All Rights Reserved. */ package com.alipay.zdal.parser.sql.ast.expr; import com.alipay.zdal.parser.sql.ast.SQLExprImpl; import com.alipay.zdal.parser.sql.ast.statement.SQLSelect; import com.alipay.zdal.parser.sql.visitor.SQLASTVisitor; /** * * @author xiaoqing.zhouxq * @version $Id: SQLAnyExpr.java, v 0.1 2012-11-17 ����3:14:43 xiaoqing.zhouxq Exp $ */ public class SQLAnyExpr extends SQLExprImpl { private static final long serialVersionUID = 1L; public SQLSelect subQuery; public SQLAnyExpr() { } public SQLAnyExpr(SQLSelect select) { this.subQuery = select; } public SQLSelect getSubQuery() { return this.subQuery; } public void setSubQuery(SQLSelect subQuery) { this.subQuery = subQuery; } public void output(StringBuffer buf) { this.subQuery.output(buf); } @Override protected void accept0(SQLASTVisitor visitor) { if (visitor.visit(this)) { acceptChild(visitor, this.subQuery); } visitor.endVisit(this); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((subQuery == null) ? 0 : subQuery.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; } SQLAnyExpr other = (SQLAnyExpr) obj; if (subQuery == null) { if (other.subQuery != null) { return false; } } else if (!subQuery.equals(other.subQuery)) { return false; } return true; } }