public class QueryInfo
extends java.lang.Object
Constructor and Description |
---|
QueryInfo()
Constructs an empty QueryInfo.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnd(java.lang.String sLeftExpr,
java.lang.String sOperator,
java.lang.String sRightExpr,
java.lang.String sLogic,
boolean bEndOfGroup)
Adds an AndInfo.
|
void |
addColumn(java.lang.String sColumnMappingName,
java.lang.String sColumnName,
java.lang.String sExpression,
boolean bCompCol,
java.lang.String sTableMappingName,
int iColumnIndex)
Adds a ColumnInfo.
|
void |
addFormula(java.lang.String sName,
java.lang.String sExpression,
boolean bNonSQLCriterion)
Adds a FormulaInfo.
|
void |
addFormula(java.lang.String sName,
java.lang.String sExpression,
java.lang.String value,
boolean bNonSQLCriterion)
Adds a FormulaInfo.
|
void |
addJoin(java.lang.String sColumnFrom,
java.lang.String sOperator,
java.lang.String sColumnTo,
int iJoinType,
boolean bSQL92,
boolean bSelfJoin)
Adds a JoinInfo.
|
void |
addOrderBy(java.lang.String sColumnMappingName,
java.lang.String order)
Adds an OrderByInfo.
|
void |
addParameter(java.lang.String sName,
java.lang.String sType,
java.lang.String sValue)
Adds a ParameterInfo.
|
void |
addQbeCriterion(java.lang.String sColumnMappingName,
int iRowNumber,
java.lang.String sExpression)
Adds a QBE criterion to this query.
|
void |
addSubLink(java.lang.String sSubColumnMappingName,
java.lang.String sOperator,
java.lang.String sValue)
Adds a SubLinkInfo.
|
void |
addTable(java.lang.String sMappingName,
java.lang.String sTableName,
java.lang.String sCorrelationName,
java.lang.String sSchemaName,
java.lang.String sCatalogName)
Adds a TableInfo.
|
AndInfo[] |
getAnds()
Gets the array of the AndInfo in this query.
|
ColumnInfo |
getColumn(java.lang.String name)
Gets the ColumnInfo by the specified name.
|
ColumnInfo[] |
getColumns()
Gets the array of the ColumnInfo of all columns in this query, no matter
it is a selected column or not.
|
ConnectionInfo |
getConnection()
Gets ConnectionInfo of this query.
|
java.lang.Object |
getEntityByName(java.lang.String sMappingName)
Gets an entity (column, parameter or formula) by the specified name.
|
FormulaInfo[] |
getFormulas()
Gets the array of the FormulaInfo of this query.
|
JoinInfo[] |
getJoins()
Gets array of JoinInfo in this query.
|
OrderByInfo[] |
getOrderBys()
Gets the array of the OrderByInfo of this query.
|
ParameterInfo[] |
getParameters()
Gets the array of the ParameterInfo of this query.
|
QBEInfo[] |
getQbes()
Gets the array of the QBEInfo in this query.
|
java.lang.String |
getQueryName()
Gets the name of this query.
|
java.lang.String |
getReportFilter()
Gets report level filter.
|
ColumnInfo[] |
getSelectColumns()
Gets the array of the ColumnInfo of the referenced selected columns in this query.
|
ColumnInfo[] |
getSelectColumns(boolean referencedOnly)
Gets the array of the ColumnInfo of the selected columns in this query.
|
SubLinkInfo[] |
getSubLinks()
Gets the array of the SubLinkInfo of this query.
|
TableInfo[] |
getTables()
Gets a Vector of TableInfo of all used tables in this query.
|
java.lang.String |
getWherePortionString()
Gets the where portion string.
|
boolean |
isDistinct()
Gets whether this query is selected distinct.
|
boolean |
isIgnorePredicateIfParamIsNull()
Gets the value of the option "ignore predicate if parameter is null" of this query.
|
void |
removeAllParameters()
Remove all ParameterInfo in this QeuryInfo.
|
void |
removeAllSubLinks()
Removes all SubLinkInfo in this query.
|
ParameterInfo |
removeParameter(java.lang.String sParameterName)
Removes a specified ParameterInfo.
|
SubLinkInfo |
removeSubLink(java.lang.String sSubColName)
Removes a specified SubLinkInfo.
|
void |
setConnection(java.lang.String sDriver,
java.lang.String sURL,
java.lang.String sUser,
java.lang.String sPassword,
java.lang.String sDateFormat,
java.lang.String sTimeFormat,
java.lang.String sTimestampFormat,
int iTransactionIsolation,
int iReadOnly,
int iQualifiedNamePattern,
int iExtraNamePattern,
int iEncodingPattern)
Sets connectionInfo's variables to the specified values.
|
void |
setDistinct(boolean bDistinct)
Sets the flag of the selected distinct of this query to the specified value.
|
void |
setIgnorePredicateIfParamIsNull(boolean bIgnorePredicateIfParamIsNull)
Sets the flag of the option "Ignore Predicate If Param Is Null" of this query to
the specified value.
|
void |
setQueryName(java.lang.String sQueryName)
Sets the name of this query to the specified value.
|
void |
setReportFilter(java.lang.String sFilter)
Sets report level filter.
|
void |
setWherePortionString(java.lang.String sWherePortion)
Sets where the portion string.
|
void |
updateParameterValue(java.lang.String sParameterName,
java.lang.String sValue)
Updates the value of a specific ParameterInfo in a query.
|
void |
updateSubLinkValue(java.lang.String sSubColName,
java.lang.String sValue)
Updates the value of a specific SubLinkInfo in a query.
|
public void setQueryName(java.lang.String sQueryName)
sQueryName
- Name of the query.public java.lang.String getQueryName()
public void setConnection(java.lang.String sDriver, java.lang.String sURL, java.lang.String sUser, java.lang.String sPassword, java.lang.String sDateFormat, java.lang.String sTimeFormat, java.lang.String sTimestampFormat, int iTransactionIsolation, int iReadOnly, int iQualifiedNamePattern, int iExtraNamePattern, int iEncodingPattern)
sDriver
- Driver name used to connect to the database.sURL
- JDBC url.sUser
- The user name used to connect to the database.sPassword
- The user's password.sDateFormat
- Format of date type.sTimeFormat
- Format of time type.sTimestampFormat
- Format of timestemp type.iTransactionIsolation
- Transaction level of the connectionInfo.iReadOnly
- Read-only property of the connectionInfo.iQualifiedNamePattern
- Qualified pattern of the table name.iExtraNamePattern
- Qualified name pattern.iEncodingPattern
- Encoding option when getting string from ResultSet.
#ConnectionInfo
public ConnectionInfo getConnection()
#ConnectionInfo
public void setDistinct(boolean bDistinct)
bDistince
- Selected distinct value to set.public boolean isDistinct()
public void setIgnorePredicateIfParamIsNull(boolean bIgnorePredicateIfParamIsNull)
bIgnorePredicateIfParamIsNull
- Value of the option "Ignore Predicate If
Param Is Null" to be set.public boolean isIgnorePredicateIfParamIsNull()
public void addTable(java.lang.String sMappingName, java.lang.String sTableName, java.lang.String sCorrelationName, java.lang.String sSchemaName, java.lang.String sCatalogName)
sMappingName
- The mapping name of the newly added TableInfo.sTableName
- The real database name of the newly added TableInfo.sCorrelationName
- The correlation name of the newly added TableInfo.sSchemaName
- The schema name of the newly added TableInfo.sCatalogName
- The catalog name of the newly added TableInfo.
#TableInfo
public TableInfo[] getTables()
#TableInfo
public void addColumn(java.lang.String sColumnMappingName, java.lang.String sColumnName, java.lang.String sExpression, boolean bCompCol, java.lang.String sTableMappingName, int iColumnIndex)
sMappingName
- The mapping name of the newly added column.sColumnName
- The real database name of the newly added column.sExpression
- The expression of the newly added column, if it represents a computed column.bCompCol
- Flag which indicates whether the newly added column is a computed column.sTableMappingName
- The mapping name of the table.iColumnIndex
- The index of the added column.
#ColumnInfo
public ColumnInfo getColumn(java.lang.String name)
name
- The column name.#ColumnInfo
public ColumnInfo[] getColumns()
#ColumnInfo
public ColumnInfo[] getSelectColumns()
Note, all columns in this array are in order as they should appear in Select clause when creating a runtime SQL statement.getSelectColumns(true)
getSelectColumns(boolean)
,
{@link #ColumnInfo}
public ColumnInfo[] getSelectColumns(boolean referencedOnly)
true
to
the parameter referencedOnly
, only the referenced selected
columns of the report will be included in the return array, otherwise
all selected columns will be included.referencedOnly
- Only select the columns that are referenced in a
report at runtime or not.getSelectColumns()
,
ColumnInfo.getColumnIndex()
public void addJoin(java.lang.String sColumnFrom, java.lang.String sOperator, java.lang.String sColumnTo, int iJoinType, boolean bSQL92, boolean bSelfJoin)
sColumnFrom
- The mapping name of FROM column of the newly added JoinInfo.sOperator
- The operator of the newly added JoinInfo.sColumnTo
- The mapping name of To column of the newly added JoinInfo.
#JoinInfo
public JoinInfo[] getJoins()
#JoinInfo
public void addQbeCriterion(java.lang.String sColumnMappingName, int iRowNumber, java.lang.String sExpression)
sColumnMappingName
- The mapping name of the column which this criterion will be based on.iRowNumber
- Row number of the criterion.sExpression
- Criterion in the corresponding row.
#QBEInfo
public QBEInfo[] getQbes()
#QBEInfo
public void addAnd(java.lang.String sLeftExpr, java.lang.String sOperator, java.lang.String sRightExpr, java.lang.String sLogic, boolean bEndOfGroup)
sLeftExpr
- Left expression value of the newly added AndInfo.sOperator
- Operator value of the newly added AndInfo.sLeftExpr
- Right expression value of the newly added AndInfo.sLogic
- Logic value of the newly added AndInfo.bEndOfGroup
- Flag to indicate whether this newly added AndInfo is the last condition in a group.
#AndInfo
public AndInfo[] getAnds()
AndInfo
are
predefined in the query, but if you run reports through JREngine
and call JREngine.setNamedWherePortion(String)
to set a predefined
where portion, the return AndInfos are those conditions in that where portion.{@link #AndInfo}
public void setWherePortionString(java.lang.String sWherePortion)
sWherePortion
- Where condition string to be set to this query. It will replace the
Where clause.public java.lang.String getWherePortionString()
jet.bean.JREngine
,
you can call setWherePortion(String)
to replace the Where clause by
the specified string. In that case, you can call this method to retrieve
the string you just set.JREngine.setWherePortion(String)
public void addSubLink(java.lang.String sSubColumnMappingName, java.lang.String sOperator, java.lang.String sValue)
sSubColumnMappingName
- The mapping name of the ColumnInfo of the SubLinkInfo to be added to this query.sOperator
- Operator of the SubLinkInfo to be added to this query.sValue
- Value of the field in the main report of the SubLink to be added to this query.
#SubLinkInfo
public void updateSubLinkValue(java.lang.String sSubColName, java.lang.String sValue)
sSubColName
- Mapping name of the SubLinkInfo that will be updated.sValue
- Value of the SubLinkInfo that will be updated.
#SubLinkInfo
public SubLinkInfo removeSubLink(java.lang.String sSubColName)
sSubColName
- Mapping name of the SubLinkInfo that will be removed.#SubLinkInfo
public void removeAllSubLinks()
#SubLinkInfo
public SubLinkInfo[] getSubLinks()
#SubLinkInfo
public void addOrderBy(java.lang.String sColumnMappingName, java.lang.String order)
sColumnMappingName
- Mapping name of the ColumnInfo of the OrderByInfo to be added to this query.order
- The order of the OrderByInfo to be added to this query.
#OrderByInfo
public OrderByInfo[] getOrderBys()
#OrderByInfo
public void addParameter(java.lang.String sName, java.lang.String sType, java.lang.String sValue)
sName
- The mapping name of the ParameterInfo to be added to this query.stype
- The data type of the ParameterInfo to be added to this query, represented in string.sValue
- The value of the ParameterInfo to be added to this query, represented in string.
#ParameterInfo
public void updateParameterValue(java.lang.String sParameterName, java.lang.String sValue)
sParameterName
- Mapping name of the ParameterInfo that will be updated.sValue
- value of the ParameterInfo that will be updated.
#ParameterInfo
public ParameterInfo removeParameter(java.lang.String sParameterName)
sParameterName
- Mapping name of the ParameterInfo that will be removed.#ParameterInfo
public void removeAllParameters()
#ParameterInfo
public ParameterInfo[] getParameters()
#ParameterInfo
public void addFormula(java.lang.String sName, java.lang.String sExpression, boolean bNonSQLCriterion)
sName
- The mapping name of the FormulaInfo to be added to this query.sExpression
- The expression of the FormulaInfo to be added to this query.bNonSQLCriterion
- The flag which indicates if this formula is a non-SQL criterion.
#FormulaInfo
public void addFormula(java.lang.String sName, java.lang.String sExpression, java.lang.String value, boolean bNonSQLCriterion)
sName
- The mapping name of the FormulaInfo to be added to this query.sExpression
- The expression of the FormulaInfo to be added to this query.value
- The value of the FormulaInfo to be added to this query.bNonSQLCriterion
- The flag which indicates if this formula is a non-SQL criterion.
#FormulaInfo
public FormulaInfo[] getFormulas()
#FormulaInfo
public java.lang.Object getEntityByName(java.lang.String sMappingName)
sMappingName
- The name of the entity to be searched for.public java.lang.String getReportFilter()
public void setReportFilter(java.lang.String sFilter)