Class SPParameter

  • All Implemented Interfaces:
    Cloneable

    public class SPParameter
    extends Object
    implements Cloneable
    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.
    • Field Detail

      • INOUT

        public static final int INOUT
        Constant identifying an INOUT parameter
        See Also:
        Constant Field Values
      • RETURN_VALUE

        public static final int RETURN_VALUE
        Constant identifying a RETURN parameter
        See Also:
        Constant Field Values
      • RESULT_SET

        public static final int RESULT_SET
        Constant identifying a RESULT SET parameter
        See Also:
        Constant Field Values
    • Constructor Detail

      • SPParameter

        public SPParameter​(int index,
                           Expression expression)
        Constructor used when constructing a parameter during execution. In this case we know what the parameter is being filled with but no metadata about the parameter.
        Parameters:
        index - the positional index of this parameter
        expression - the Value of this parameter
      • SPParameter

        public SPParameter​(int index,
                           int parameterType,
                           String name)
        Constructor used when constructing a parameter from metadata. In this case we specify the description of the parameter but no notion of what it is being filled with.
        Parameters:
        index - Parameter index
        parameterType - Type of parameter based on class constant - IN, OUT, etc
        name - Full name of parameter (including proc name)
    • Method Detail

      • getName

        public String getName()
        Get full parameter name,. If unknown, null is returned.
        Returns:
        Parameter name
      • setName

        public void setName​(String name)
        Set full parameter name
        Parameters:
        name - Parameter name
      • getClassType

        public Class<?> getClassType()
        Get class type - MetaMatrix runtime types.
        Returns:
        MetaMatrix runtime type description
      • setExpression

        public void setExpression​(Expression expression)
        Set the expression defining this parameter
        Parameters:
        expression - The expression defining this parameter's value
      • getExpression

        public Expression getExpression()
        Return the expression defining the value of this parameter
        Returns:
        Expression defining the value of this parameter
      • setIndex

        public void setIndex​(int index)
        Set the positional index of this parameter
        Parameters:
        index - The positional index of this parameter
      • getIndex

        public int getIndex()
        Return the index of this parameter
        Returns:
        The index
      • addResultSetColumn

        public void addResultSetColumn​(String colName,
                                       Class<?> type,
                                       Object id)
        Add a result set column if this parameter is a return result set.
        Parameters:
        colName - Name of column
        type - Type of column
      • getResultSetColumns

        public List<ElementSymbol> getResultSetColumns()
        Get the result set columns. If none exist, return empty list.
        Returns:
        List of ElementSymbol representing result set columns
      • getResultSetIDs

        public List<Object> getResultSetIDs()
        Get the result set metadata IDs. If none exist, return empty list.
        Returns:
        List of Object representing result set metadata IDs
      • getResultSetColumn

        public ElementSymbol getResultSetColumn​(int position)
        Get a particular result set column at the specified position.
        Parameters:
        position - Position of the result set column
        Returns:
        Element symbol representing the result set column at position
        Throws:
        IllegalArgumentException - If column doesn't exist
      • getMetadataID

        public Object getMetadataID()
        Get actual metadataID for this parameter
        Returns:
        Actual metadata ID for this parameter
      • setMetadataID

        public void setMetadataID​(Object metadataID)
        Set actual metadataID for this parameter
        Parameters:
        metadataID - Actual metadataID
      • getParameterSymbol

        public ElementSymbol getParameterSymbol()
        Get element symbol representing this parameter. The symbol will have the same name and type as the parameter.
        Returns:
        Element symbol representing the parameter
      • isUsingDefault

        public boolean isUsingDefault()
      • setUsingDefault

        public void setUsingDefault​(boolean usingDefault)
      • setVarArg

        public void setVarArg​(boolean varArg)
      • isVarArg

        public boolean isVarArg()