org.teiid.query.sql.lang.SPParameter Maven / Gradle / Ivy
/*
* Copyright Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags and
* the COPYRIGHT.txt file distributed with this work.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.teiid.query.sql.lang;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.teiid.client.metadata.ParameterInfo;
import org.teiid.core.util.EquivalenceUtil;
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
/**
* Represents a StoredProcedure's parameter for encapsulation in the Query framework
* This is basically a holder object set from the Server's implementation of
* a stored procedure.
* The connector will utilize this class to set the appropriate values at the
* datasource layer.
*/
public class SPParameter implements Cloneable {
/** Constant identifying an IN parameter */
public static final int IN = ParameterInfo.IN;
/** Constant identifying an OUT parameter */
public static final int OUT = ParameterInfo.OUT;
/** Constant identifying an INOUT parameter */
public static final int INOUT = ParameterInfo.INOUT;
/** Constant identifying a RETURN parameter */
public static final int RETURN_VALUE = ParameterInfo.RETURN_VALUE;
/** Constant identifying a RESULT SET parameter */
public static final int RESULT_SET = ParameterInfo.RESULT_SET;
// Basic state
private int parameterType = ParameterInfo.IN;
private Expression expression;
private int index;
private List resultSetColumns; //contains List of columns if it is result set
private List