/* Generated By:JJTree: Do not edit this line. QueryCommand.java Version 4.3 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=true,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package org.teiid.query.sql.lang;
import java.util.List;
import org.teiid.designer.query.sql.lang.IQueryCommand;
import org.teiid.designer.runtime.version.spi.ITeiidServerVersion;
import org.teiid.query.parser.LanguageVisitor;
import org.teiid.query.sql.symbol.Expression;
/**
*
*/
public abstract class QueryCommand extends Command
implements IQueryCommand<OrderBy, Query, Expression, LanguageVisitor> {
/** The order in which to sort the results */
private OrderBy orderBy;
/** Limit on returned rows */
private Limit limit;
private List<WithQueryCommand> with;
/**
* @param p
* @param id
*/
public QueryCommand(ITeiidServerVersion p, int id) {
super(p, id);
}
/**
* Get the order by clause for the query.
* @return order by clause
*/
@Override
public OrderBy getOrderBy() {
return orderBy;
}
/**
* Set the order by clause for the query.
* @param orderBy New order by clause
*/
@Override
public void setOrderBy(OrderBy orderBy) {
this.orderBy = orderBy;
}
/**
* @return limit
*/
public Limit getLimit() {
return limit;
}
/**
* @param limit
*/
public void setLimit(Limit limit) {
this.limit = limit;
}
/**
* @return with
*/
public List<WithQueryCommand> getWith() {
return with;
}
/**
* @param with
*/
public void setWith(List<WithQueryCommand> with) {
this.with = with;
}
@Override
public boolean returnsResultSet() {
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((this.limit == null) ? 0 : this.limit.hashCode());
result = prime * result + ((this.orderBy == null) ? 0 : this.orderBy.hashCode());
result = prime * result + ((this.with == null) ? 0 : this.with.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (!super.equals(obj)) return false;
if (getClass() != obj.getClass()) return false;
QueryCommand other = (QueryCommand)obj;
if (this.limit == null) {
if (other.limit != null) return false;
} else if (!this.limit.equals(other.limit)) return false;
if (this.orderBy == null) {
if (other.orderBy != null) return false;
} else if (!this.orderBy.equals(other.orderBy)) return false;
if (this.with == null) {
if (other.with != null) return false;
} else if (!this.with.equals(other.with)) return false;
return true;
}
/** Accept the visitor. **/
@Override
public void acceptVisitor(LanguageVisitor visitor) {
visitor.visit(this);
}
@Override
public abstract QueryCommand clone();
}
/* JavaCC - OriginalChecksum=e5518987c086d24b10346b06ef207602 (do not edit this line) */