@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (select == null ? 0 : select.hashCode()); result = prime * result + (from == null ? 0 : from.hashCode()); result = prime * result + (where == null ? 0 : where.hashCode()); result = prime * result + (orderBy == null ? 0 : orderBy.hashCode()); result = prime * result + (groupBy == null ? 0 : groupBy.hashCode()); result = prime * result + (having == null ? 0 : having.hashCode()); result = prime * result + (int) (limit ^ (limit >>> 32)); result = prime * result + (int) (offset ^ (offset >>> 32)); return result; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } SQLQuery other = (SQLQuery) obj; if (select == null) { if (other.select != null) { return false; } } else if (!select.equals(other.select)) { return false; } if (from == null) { if (other.from != null) { return false; } } else if (!from.equals(other.from)) { return false; } if (where == null) { if (other.where != null) { return false; } } else if (!where.equals(other.where)) { return false; } if (orderBy == null) { if (other.orderBy != null) { return false; } } else if (!orderBy.equals(other.orderBy)) { return false; } if (groupBy == null) { if (other.groupBy != null) { return false; } } else if (!groupBy.equals(other.groupBy)) { return false; } if (having == null) { if (other.having != null) { return false; } } else if (!having.equals(other.having)) { return false; } if (limit != other.limit) { return false; } if (offset != other.offset) { return false; } return true; }