/** * Checks whether another parameter equals this one based on the index. * @see java.lang.Object#equals(Object) */ public boolean equals(Object obj) { if(obj == this) { return true; } if(!(obj instanceof SPParameter)){ return false; } //the parameters are considered equal if the indexes are the same SPParameter other = (SPParameter) obj; if (this.getIndex() != other.getIndex()) { return false; } // If indexes match, check associated IDs if existent return EquivalenceUtil.areEqual(this.expression, other.expression); }
/** * Checks whether another parameter equals this one based on the index. * @see java.lang.Object#equals(Object) */ public boolean equals(Object obj) { if(obj == this) { return true; } if(!(obj instanceof SPParameter)){ return false; } //the parameters are considered equal if the indexes are the same SPParameter other = (SPParameter) obj; if (this.getIndex() != other.getIndex()) { return false; } // If indexes match, check associated IDs if existent return EquivalenceUtil.areEqual(this.expression, other.expression); }
/** * Checks whether another parameter equals this one based on the index. * @see java.lang.Object#equals(Object) */ public boolean equals(Object obj) { if(obj == this) { return true; } if(!(obj instanceof SPParameter)){ return false; } //the parameters are considered equal if the indexes are the same SPParameter other = (SPParameter) obj; if (this.getIndex() != other.getIndex()) { return false; } // If indexes match, check associated IDs if existent return EquivalenceUtil.areEqual(this.expression, other.expression); }
/** * Set a stored procedure's parameter * * @param index the index of the parameter to set * @param parameter <code>StoredProcedureParameter</code> the parameter * @throws IllegalArgumentExcecption if the parameters (index and parameter) * are invalid. */ public void setParameter(SPParameter parameter){ if(parameter == null){ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0011")); //$NON-NLS-1$ } Integer key = parameter.getIndex(); if(parameter.getParameterType() == ParameterInfo.RESULT_SET){ resultSetParameterKey = key; } mapOfParameters.put(key, parameter); }
/** * Set a stored procedure's parameter * * @param index the index of the parameter to set * @param parameter <code>StoredProcedureParameter</code> the parameter * @throws IllegalArgumentExcecption if the parameters (index and parameter) * are invalid. */ public void setParameter(SPParameter parameter){ if(parameter == null){ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0011")); //$NON-NLS-1$ } Integer key = parameter.getIndex(); if(parameter.getParameterType() == ParameterInfo.RESULT_SET){ resultSetParameterKey = key; } mapOfParameters.put(key, parameter); }
/** * Set a stored procedure's parameter * * @param index the index of the parameter to set * @param parameter <code>StoredProcedureParameter</code> the parameter * @throws IllegalArgumentExcecption if the parameters (index and parameter) * are invalid. */ public void setParameter(SPParameter parameter){ if(parameter == null){ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0011")); //$NON-NLS-1$ } Integer key = parameter.getIndex(); if(parameter.getParameterType() == ParameterInfo.RESULT_SET){ resultSetParameterKey = key; } mapOfParameters.put(key, parameter); }
positionalExpressions.put(param.getIndex() + adjustIndex, param.getExpression());
positionalExpressions.put(param.getIndex() + adjustIndex, param.getExpression());
positionalExpressions.put(param.getIndex() + adjustIndex, param.getExpression());
private void helpCheckParameter(SPParameter param, int paramType, int index, String name, Class<?> type, Expression expr) { assertEquals("Did not get expected parameter type", paramType, param.getParameterType()); //$NON-NLS-1$ assertEquals("Did not get expected index for param", index, param.getIndex()); //$NON-NLS-1$ assertEquals("Did not get expected name for param", name, param.getName()); //$NON-NLS-1$ assertEquals("Did not get expected type for param", type, param.getClassType()); //$NON-NLS-1$ assertEquals("Did not get expected type for param", expr, param.getExpression()); //$NON-NLS-1$ }