Class ParameterTable


  • public class ParameterTable
    extends Object
    The query parameter table
    Version:
    0.1
    Author:
    Michael Bouschen
    • Field Detail

      • messages

        protected static final ResourceBundle messages
        I18N support
    • Constructor Detail

      • ParameterTable

        public ParameterTable()
      • ParameterTable

        public ParameterTable​(ParameterTable other)
        Copy constructor.
        Parameters:
        other - the ParameterTable to be copied
    • Method Detail

      • add

        public void add​(String name,
                        Type type)
        Adds a new query parameter with the specified type to the query parameter table.
      • init

        public void init()
        Initializes the parameter declarations (names and types list). Needs to be called prior to any add call.
      • initValueHandling

        public void initValueHandling()
        Initializes the parameter values. This methods sets the values for all declared parameters to unbound.
      • setValues

        public void setValues​(Object[] actualParams)
        Check actual query parameters specified as array and return the ValueFetcher for the inputparameters.
        Parameters:
        actualParams -
      • checkUnboundParams

        public void checkUnboundParams()
        Checks whether all parameters have an actual value.
      • setValues

        public void setValues​(Map actualParams)
        Check actual query parameters specified as map and return the ValueFetcher for the inputparameters.
        Parameters:
        actualParams -
      • getValueByName

        public Object getValueByName​(String name)
        Returns the value of the parameter with the specified name.
      • getValueByIndex

        public Object getValueByIndex​(int index)
        Returns the value of the parameter with the specified index.
      • getValues

        public List getValues()
        Returns the list of parameter values.
      • getValueFetcher

        public ValueFetcher getValueFetcher()
        Wraps the actual parameter array into a ValueFetcher instnace.
        Returns:
        Instance of ValueFetcher
      • getKeyForRetrieveDescCache

        public String getKeyForRetrieveDescCache()
        Calculates and returns the key for the RetrieveDesc cache based, on the actual parameter values. A null return means, the RetrieveDesc should not be cached. Note, this method needs to be in sync with method inline.
      • inline

        public boolean inline​(String paramName)
        Returns true if the parameter with the specified index should be inlined by the optimizer. Note, this method needs to be in sync with method getKeyForRetrieveDescCache.
        Parameters:
        paramName - the parameter
        Returns:
        true if the specified parameter should be inlined.
      • getIndexForParamName

        public Integer getIndexForParamName​(String paramName)
        Deprecated.
        Returns the parameter index for the specified parameter name.
      • getParameterInfoForParamName

        public ParameterInfo getParameterInfoForParamName​(String paramName)
        Returns the parameter info for the specified parameter name.
        Parameters:
        paramName -
        Returns:
        corresponding parameterInfo
      • getParameterInfoForParamName

        public ParameterInfo getParameterInfoForParamName​(String paramName,
                                                          String associatedField)
        Returns the parameter info for the specified parameter name and associated field. If the associated field is not known, then null is used as input parameter.
        Parameters:
        paramName -
        associatedField -
        Returns:
        corresponding parameterInfo