/** * Compare this constant to another constant for equality. * @param obj Other object * @return True if constants are equal */ public boolean equals(Object obj) { if(this == obj) { return true; } if(!(obj instanceof Reference)) { return false; } Reference other = (Reference) obj; if (this.positional != other.positional) { return false; } if (this.positional) { return other.getIndex() == getIndex(); } // Compare based on name return this.expression.equals(other.expression); }
/** * Compare this constant to another constant for equality. * @param obj Other object * @return True if constants are equal */ public boolean equals(Object obj) { if(this == obj) { return true; } if(!(obj instanceof Reference)) { return false; } Reference other = (Reference) obj; if (this.positional != other.positional) { return false; } if (this.positional) { return other.getIndex() == getIndex(); } // Compare based on name return this.expression.equals(other.expression); }
/** * Compare this constant to another constant for equality. * @param obj Other object * @return True if constants are equal */ public boolean equals(Object obj) { if(this == obj) { return true; } if(!(obj instanceof Reference)) { return false; } Reference other = (Reference) obj; if (this.positional != other.positional) { return false; } if (this.positional) { return other.getIndex() == getIndex(); } // Compare based on name return this.expression.equals(other.expression); }
@Override public Expression replaceExpression(Expression element) { if (!(element instanceof Reference)) { return element; } Reference ref = (Reference)element; if (!ref.isPositional()) { return ref; } return elements.get(ref.getIndex()).clone(); } };
/** * Define hash code to be that of the underlying object to make it stable. * @return Hash code, based on value */ public int hashCode() { if (this.isPositional()) { return getIndex(); } return this.expression.hashCode(); }
/** * Define hash code to be that of the underlying object to make it stable. * @return Hash code, based on value */ public int hashCode() { if (this.isPositional()) { return getIndex(); } return this.expression.hashCode(); }
/** * Define hash code to be that of the underlying object to make it stable. * @return Hash code, based on value */ public int hashCode() { if (this.isPositional()) { return getIndex(); } return this.expression.hashCode(); }
List<Reference> references = ReferenceCollectorVisitor.getReferences(query); for (int i = 0; i < references.size(); i++) { int index = references.get(i).getIndex(); stmt.setObject(i+1, parameters.get(index).getValue(), parameters.get(index).getSqlType());