Class SimpleQueryInParam

java.lang.Object
quadbase.reportdesigner.util.SimpleQueryInParam
All Implemented Interfaces:
quadbase.common.util.IQueryInParam, IQueryInParam
Direct Known Subclasses:
SimpleQueryMultiValueInParam

public class SimpleQueryInParam extends Object implements IQueryInParam
  • Field Details

    • value

      protected Object value
  • Constructor Details

    • SimpleQueryInParam

      public SimpleQueryInParam(String paramName, String promptName, boolean mapToColumn, String tableName, String columnName, int sqlType, Object defaultValue, Object value)
    • SimpleQueryInParam

      public SimpleQueryInParam(String paramName, String promptName, boolean mapToColumn, boolean mapToFunction, String tableName, String fullFunction, int sqlType, Object defaultValue, Object value)
    • SimpleQueryInParam

      public SimpleQueryInParam(String paramName, String promptName, boolean mapToColumn, boolean mapToFunction, String tableName, String fullFunction, String sqlSelect, int sqlType, Object defaultValue, String defaultSql, boolean allOptionEnabled, String allOptionLabel, Object value)
  • Method Details

    • getParamName

      public String getParamName()
      Description copied from interface: IQueryInParam
      Returns the parameter name which is used in the SQL statement. Every colon in the SQL statement is immediately followed by a parameter name. For instance: "select drink, quantity, high, low from table1 where drink = :param1 and quantity > :param2 and :param2 > low and :param2 invalid input: '<' high" This statement has two parameters, param1 and param2. QbChart uses IQueryFileInfo to create a parameterized query to retrieve data from database. A user-friendly dialog pops up to let users input the values of the parameters in run time. The some dialog pops up later again when users press Ctrl-E (E for enter/edit parameters).
      Specified by:
      getParamName in interface quadbase.common.util.IQueryInParam
      Specified by:
      getParamName in interface IQueryInParam
      See Also:
    • getPromptName

      public String getPromptName()
      Description copied from interface: IQueryInParam
      Returns the description of the parameter displayed on the pop up dialog.
      Specified by:
      getPromptName in interface quadbase.common.util.IQueryInParam
      Specified by:
      getPromptName in interface IQueryInParam
    • setPromptName

      public void setPromptName(String promptName)
      Description copied from interface: IQueryInParam
      Set the description of the parameter displayed on the pop up dialog.
      Specified by:
      setPromptName in interface quadbase.common.util.IQueryInParam
      Specified by:
      setPromptName in interface IQueryInParam
    • isMapToColumn

      public boolean isMapToColumn()
      Description copied from interface: IQueryInParam
      If isMapToColumn() returns true, getTableName() and getColumnName() will be called to find out all distinct values from database. Then the values will be displayed in a choice box. The java.sql.Types of the column is retrived from the meta data of database. If isMapToColumn() returns false, getSqlType() is called to get the java.sql.Types of the input value. A text field will be shown instead of a choice box. It is useful if you don't want to expose the contents of database.
      Specified by:
      isMapToColumn in interface quadbase.common.util.IQueryInParam
      Specified by:
      isMapToColumn in interface IQueryInParam
    • isMapToColumnOnly

      public boolean isMapToColumnOnly()
    • setMapToColumn

      public void setMapToColumn(boolean mapToColumn)
      Description copied from interface: IQueryInParam
      Enables or disables mapToColumn.
      Specified by:
      setMapToColumn in interface quadbase.common.util.IQueryInParam
      Specified by:
      setMapToColumn in interface IQueryInParam
    • isMapToFunctionOnly

      public boolean isMapToFunctionOnly()
    • setMapToFunction

      public void setMapToFunction(boolean mapToFunction)
    • getTableName

      public String getTableName()
      Description copied from interface: IQueryInParam
      Returns the table name
      Specified by:
      getTableName in interface quadbase.common.util.IQueryInParam
      Specified by:
      getTableName in interface IQueryInParam
      See Also:
    • setTableName

      public void setTableName(String tableName)
      Description copied from interface: IQueryInParam
      Set the table name
      Specified by:
      setTableName in interface quadbase.common.util.IQueryInParam
      Specified by:
      setTableName in interface IQueryInParam
    • getColumnName

      public String getColumnName()
      Description copied from interface: IQueryInParam
      Returns the column name
      Specified by:
      getColumnName in interface quadbase.common.util.IQueryInParam
      Specified by:
      getColumnName in interface IQueryInParam
      See Also:
    • setColumnName

      public void setColumnName(String columnName)
      Description copied from interface: IQueryInParam
      Set the column name
      Specified by:
      setColumnName in interface quadbase.common.util.IQueryInParam
      Specified by:
      setColumnName in interface IQueryInParam
    • getSqlType

      public int getSqlType()
      Description copied from interface: IQueryInParam
      Returns java.sql.Types
      Specified by:
      getSqlType in interface quadbase.common.util.IQueryInParam
      Specified by:
      getSqlType in interface IQueryInParam
      See Also:
    • setSqlType

      public void setSqlType(int sqlType)
      Description copied from interface: IQueryInParam
      Set java.sql.Types
      Specified by:
      setSqlType in interface quadbase.common.util.IQueryInParam
      Specified by:
      setSqlType in interface IQueryInParam
    • getDefaultValue

      public Object getDefaultValue()
      Description copied from interface: IQueryInParam
      Returns the default value
      Specified by:
      getDefaultValue in interface quadbase.common.util.IQueryInParam
      Specified by:
      getDefaultValue in interface IQueryInParam
    • setDefaultValue

      public void setDefaultValue(Object defaultValue)
      Description copied from interface: IQueryInParam
      Set default value
      Specified by:
      setDefaultValue in interface quadbase.common.util.IQueryInParam
      Specified by:
      setDefaultValue in interface IQueryInParam
    • getValue

      public Object getValue()
      Description copied from interface: IQueryInParam
      Programmers sometimes may not want to show the initial parameter dialog when the chart is loaded at the first time. This can be done if every parameter in IQueryFileInfo has a pre-defined non-null values. When the parameterized query is processed by the database, the parameter value is set to null automatically. Note that the defined values are not stored in query files (*.qry).
      Specified by:
      getValue in interface quadbase.common.util.IQueryInParam
      Specified by:
      getValue in interface IQueryInParam
    • setValue

      public void setValue(Object value)
      Description copied from interface: IQueryInParam
      Set the defined value. The parameter value is set to null automatically when it is processed by the database query.
      Specified by:
      setValue in interface quadbase.common.util.IQueryInParam
      Specified by:
      setValue in interface IQueryInParam
    • getDefaultValueVariable

      public quadbase.common.formula.Formula getDefaultValueVariable()
      Returns default value of a date parameter as a date expression (ex. CurrentDate - 1 WEEK)
      Returns:
      Formula date expression
    • setDefaultValueVariable

      public void setDefaultValueVariable(quadbase.common.formula.Formula f)
      Set default value of a date parameter to a date expression (ex. CurrentDate - 1 WEEK)
      Parameters:
      Formula - date expression
    • getValueVariable

      public quadbase.common.formula.Formula getValueVariable()
      Returns value of a date parameter as a date expression (ex. CurrentDate - 1 WEEK)
      Returns:
      Formula date expression
    • setValueVariable

      public void setValueVariable(quadbase.common.formula.Formula f)
      Set value of a date parameter to a date expression (ex. CurrentDate - 1 WEEK)
      Parameters:
      Formula - date expression
    • setSqlSelect

      public void setSqlSelect(String sqlSelect)
    • getSqlSelect

      public String getSqlSelect()
    • isAllOptionEnabled

      public boolean isAllOptionEnabled()
    • setAllOptionEnabled

      public void setAllOptionEnabled(boolean isAllOptionEnabled)
    • getAllOptionLabel

      public String getAllOptionLabel()
    • setAllOptionLabel

      public void setAllOptionLabel(String allOptionLabel)
    • valueOf

      public static SimpleQueryInParam valueOf(quadbase.common.util.IQueryInParam p)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDefaultSql

      public String getDefaultSql()
      Specified by:
      getDefaultSql in interface quadbase.common.util.IQueryInParam
    • setDefaultSql

      public void setDefaultSql(String defaultSql)
      Specified by:
      setDefaultSql in interface quadbase.common.util.IQueryInParam