EspressReport 6.6

quadbase.util
Class SimpleQueryInParam

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

public class SimpleQueryInParam
extends java.lang.Object
implements IQueryInParam


Field Summary
protected  java.lang.Object value
           
 
Constructor Summary
SimpleQueryInParam(java.lang.String paramName, java.lang.String promptName, boolean mapToColumn, boolean mapToFunction, java.lang.String tableName, java.lang.String fullFunction, int sqlType, java.lang.Object defaultValue, java.lang.Object value)
           
SimpleQueryInParam(java.lang.String paramName, java.lang.String promptName, boolean mapToColumn, boolean mapToFunction, java.lang.String tableName, java.lang.String fullFunction, java.lang.String sqlSelect, int sqlType, java.lang.Object defaultValue, java.lang.Object value)
           
SimpleQueryInParam(java.lang.String paramName, java.lang.String promptName, boolean mapToColumn, boolean mapToFunction, java.lang.String tableName, java.lang.String fullFunction, java.lang.String sqlSelect, int sqlType, java.lang.Object defaultValue, java.lang.String defaultSql, boolean allOptionEnabled, java.lang.String allOptionLabel, java.lang.Object value)
           
SimpleQueryInParam(java.lang.String paramName, java.lang.String promptName, boolean mapToColumn, java.lang.String tableName, java.lang.String columnName, int sqlType, java.lang.Object defaultValue, java.lang.Object value)
           
 
Method Summary
 java.lang.String getAllOptionLabel()
           
 java.lang.String getColumnName()
          Returns the column name
 java.lang.String getDefaultSql()
           
 java.lang.Object getDefaultValue()
          Returns the default value
 quadbase.common.formula.Formula getDefaultValueVariable()
          Returns default value of a date parameter as a date expression (ex.
 java.lang.String getParamName()
          Returns the parameter name which is used in the SQL statement.
 java.lang.String getPromptName()
          Returns the description of the parameter displayed on the pop up dialog.
 java.lang.String getSqlSelect()
           
 int getSqlType()
          Returns java.sql.Types
 java.lang.String getTableName()
          Returns the table name
 java.lang.Object getValue()
          Programmers sometimes may not want to show the initial parameter dialog when the chart is loaded at the first time.
 quadbase.common.formula.Formula getValueVariable()
          Returns value of a date parameter as a date expression (ex.
 boolean isAllOptionEnabled()
           
 boolean isMapToColumn()
          If isMapToColumn() returns true, getTableName() and getColumnName() will be called to find out all distinct values from database.
 boolean isMapToColumnOnly()
           
 boolean isMapToFunctionOnly()
           
 void setAllOptionEnabled(boolean isAllOptionEnabled)
           
 void setAllOptionLabel(java.lang.String allOptionLabel)
           
 void setColumnName(java.lang.String columnName)
          Set the column name
 void setDefaultSql(java.lang.String defaultSql)
           
 void setDefaultValue(java.lang.Object defaultValue)
          Set default value
 void setDefaultValueVariable(quadbase.common.formula.Formula f)
          Set default value of a date parameter to a date expression (ex.
 void setMapToColumn(boolean mapToColumn)
          Enables or disables mapToColumn.
 void setMapToFunction(boolean mapToFunction)
           
 void setPromptName(java.lang.String promptName)
          Set the description of the parameter displayed on the pop up dialog.
 void setSqlSelect(java.lang.String sqlSelect)
           
 void setSqlType(int sqlType)
          Set java.sql.Types
 void setTableName(java.lang.String tableName)
          Set the table name
 void setValue(java.lang.Object value)
          Set the defined value.
 void setValueVariable(quadbase.common.formula.Formula f)
          Set value of a date parameter to a date expression (ex.
 java.lang.String toString()
           
static SimpleQueryInParam valueOf(quadbase.common.util.IQueryInParam p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected java.lang.Object value
Constructor Detail

SimpleQueryInParam

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

SimpleQueryInParam

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

SimpleQueryInParam

public SimpleQueryInParam(java.lang.String paramName,
                          java.lang.String promptName,
                          boolean mapToColumn,
                          boolean mapToFunction,
                          java.lang.String tableName,
                          java.lang.String fullFunction,
                          java.lang.String sqlSelect,
                          int sqlType,
                          java.lang.Object defaultValue,
                          java.lang.Object value)

SimpleQueryInParam

public SimpleQueryInParam(java.lang.String paramName,
                          java.lang.String promptName,
                          boolean mapToColumn,
                          boolean mapToFunction,
                          java.lang.String tableName,
                          java.lang.String fullFunction,
                          java.lang.String sqlSelect,
                          int sqlType,
                          java.lang.Object defaultValue,
                          java.lang.String defaultSql,
                          boolean allOptionEnabled,
                          java.lang.String allOptionLabel,
                          java.lang.Object value)
Method Detail

getParamName

public java.lang.String getParamName()
Description copied from interface: quadbase.common.util.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 < 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
See Also:
IQueryFileInfo

getPromptName

public java.lang.String getPromptName()
Description copied from interface: quadbase.common.util.IQueryInParam
Returns the description of the parameter displayed on the pop up dialog.

Specified by:
getPromptName in interface quadbase.common.util.IQueryInParam

setPromptName

public void setPromptName(java.lang.String promptName)
Description copied from interface: quadbase.common.util.IQueryInParam
Set the description of the parameter displayed on the pop up dialog.

Specified by:
setPromptName in interface quadbase.common.util.IQueryInParam

isMapToColumn

public boolean isMapToColumn()
Description copied from interface: quadbase.common.util.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

isMapToColumnOnly

public boolean isMapToColumnOnly()

setMapToColumn

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

Specified by:
setMapToColumn in interface quadbase.common.util.IQueryInParam

isMapToFunctionOnly

public boolean isMapToFunctionOnly()

setMapToFunction

public void setMapToFunction(boolean mapToFunction)

getTableName

public java.lang.String getTableName()
Description copied from interface: quadbase.common.util.IQueryInParam
Returns the table name

Specified by:
getTableName in interface quadbase.common.util.IQueryInParam
See Also:
IQueryInParam.isMapToColumn()

setTableName

public void setTableName(java.lang.String tableName)
Description copied from interface: quadbase.common.util.IQueryInParam
Set the table name

Specified by:
setTableName in interface quadbase.common.util.IQueryInParam

getColumnName

public java.lang.String getColumnName()
Description copied from interface: quadbase.common.util.IQueryInParam
Returns the column name

Specified by:
getColumnName in interface quadbase.common.util.IQueryInParam
See Also:
IQueryInParam.isMapToColumn()

setColumnName

public void setColumnName(java.lang.String columnName)
Description copied from interface: quadbase.common.util.IQueryInParam
Set the column name

Specified by:
setColumnName in interface quadbase.common.util.IQueryInParam

getSqlType

public int getSqlType()
Description copied from interface: quadbase.common.util.IQueryInParam
Returns java.sql.Types

Specified by:
getSqlType in interface quadbase.common.util.IQueryInParam
See Also:
IQueryInParam.isMapToColumn()

setSqlType

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

Specified by:
setSqlType in interface quadbase.common.util.IQueryInParam

getDefaultValue

public java.lang.Object getDefaultValue()
Description copied from interface: quadbase.common.util.IQueryInParam
Returns the default value

Specified by:
getDefaultValue in interface quadbase.common.util.IQueryInParam

setDefaultValue

public void setDefaultValue(java.lang.Object defaultValue)
Description copied from interface: quadbase.common.util.IQueryInParam
Set default value

Specified by:
setDefaultValue in interface quadbase.common.util.IQueryInParam

getValue

public java.lang.Object getValue()
Description copied from interface: quadbase.common.util.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

setValue

public void setValue(java.lang.Object value)
Description copied from interface: quadbase.common.util.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

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(java.lang.String sqlSelect)

getSqlSelect

public java.lang.String getSqlSelect()

setDefaultSql

public void setDefaultSql(java.lang.String defaultSql)

getDefaultSql

public java.lang.String getDefaultSql()

isAllOptionEnabled

public boolean isAllOptionEnabled()

setAllOptionEnabled

public void setAllOptionEnabled(boolean isAllOptionEnabled)

getAllOptionLabel

public java.lang.String getAllOptionLabel()

setAllOptionLabel

public void setAllOptionLabel(java.lang.String allOptionLabel)

valueOf

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

EspressReport 6.6