|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecttoolkit.db.api.QueryInfo
public class QueryInfo
Class QueryInfo wraps all info of a query, users can retrieve info from it and build the query statement string of their own.
| Constructor Summary | |
|---|---|
QueryInfo()
Construct an empty QueryInfo. |
|
| Method Summary | |
|---|---|
void |
addAnd(java.lang.String sLeftExpr,
java.lang.String sOperator,
java.lang.String sRightExpr,
java.lang.String sLogic,
boolean bEndOfGroup)
Add a AndInfo. |
void |
addColumn(java.lang.String sColumnMappingName,
java.lang.String sColumnName,
java.lang.String sExpression,
boolean bCompCol,
java.lang.String sTableMappingName,
int iColumnIndex)
Add a ColumnInfo. |
void |
addFormula(java.lang.String sName,
java.lang.String sExpression,
boolean bNonSQLCriterion)
Add a FormulaInfo. |
void |
addFormula(java.lang.String sName,
java.lang.String sExpression,
java.lang.String value,
boolean bNonSQLCriterion)
Add a FormulaInfo. |
void |
addJoin(java.lang.String sColumnFrom,
java.lang.String sOperator,
java.lang.String sColumnTo,
int iJoinType,
boolean bSQL92,
boolean bSelfJoin)
Add a JoinInfo. |
void |
addOrderBy(java.lang.String sColumnMappingName,
java.lang.String order)
Add a OrderByInfo. |
void |
addParameter(java.lang.String sName,
java.lang.String sType,
java.lang.String sValue)
Add a ParameterInfo. |
void |
addQbeCriterion(java.lang.String sColumnMappingName,
int iRowNumber,
java.lang.String sExpression)
Add a QBE criterion to this query. |
void |
addSubLink(java.lang.String sSubColumnMappingName,
java.lang.String sOperator,
java.lang.String sValue)
Add a SubLinkInfo. |
void |
addTable(java.lang.String sMappingName,
java.lang.String sTableName,
java.lang.String sCorrelationName,
java.lang.String sSchemaName,
java.lang.String sCatalogName)
Add a TableInfo. |
AndInfo[] |
getAnds()
Get array of AndInfo in this query. |
ColumnInfo |
getColumn(java.lang.String name)
|
ColumnInfo[] |
getColumns()
Get array of ColumnInfo of all columns in this query, no matter it is a select column or not. |
ConnectionInfo |
getConnection()
Get ConnectionInfo of this query. |
java.lang.Object |
getEntityByName(java.lang.String sMappingName)
Get an entity (column, parameter or formula) by specified name. |
FormulaInfo[] |
getFormulas()
Get array of FormulaInfo of this query. |
JoinInfo[] |
getJoins()
Get array of JoinInfo in this query. |
OrderByInfo[] |
getOrderBys()
Get array of OrderByInfo of this query. |
ParameterInfo[] |
getParameters()
Get array of ParameterInfo of this query. |
QBEInfo[] |
getQbes()
Get array of QBEInfo in this query. |
java.lang.String |
getQueryName()
Get the name of this QueryInfo. |
ColumnInfo[] |
getSelectColumns()
Get array of ColumnInfo of referenced select columns in this query. |
ColumnInfo[] |
getSelectColumns(boolean referencedOnly)
Get array of ColumnInfo of select columns in this query. |
SubLinkInfo[] |
getSubLinks()
Get array of SubLinkInfo of this query. |
TableInfo[] |
getTables()
Get a Vector of TableInfo of all used tables in this query. |
java.lang.String |
getWherePortionString()
Get where portion string. |
boolean |
isDistinct()
Get whether this query is select distinct. |
boolean |
isIgnorePredicateIfParamIsNull()
Get the value of option "ignore predicate if parameter is null" of this query. |
void |
removeAllParameters()
Remove all ParameterInfos in this QeuryInfo. |
void |
removeAllSubLinks()
Remove all SubLinkInfos in this query. |
ParameterInfo |
removeParameter(java.lang.String sParameterName)
Remove a specified ParameterInfo. |
SubLinkInfo |
removeSubLink(java.lang.String sSubColName)
Remove 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)
Set connectionInfo's variables to the specified values. |
void |
setDistinct(boolean bDistinct)
Set flag of select distinct of this query to specified value. |
void |
setIgnorePredicateIfParamIsNull(boolean bIgnorePredicateIfParamIsNull)
Set flag of option "Ignore Predicate If Param Is Null" of this query to the specified value. |
void |
setQueryName(java.lang.String sQueryName)
Set the name of this QueryInfo to specified value. |
void |
setWherePortionString(java.lang.String sWherePortion)
Set where portion string which . |
void |
updateParameterValue(java.lang.String sParameterName,
java.lang.String sValue)
Update the value of a specific ParameterInfo in a query. |
void |
updateSubLinkValue(java.lang.String sSubColName,
java.lang.String sValue)
Update the value of a specific SubLinkInfo in a query. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public QueryInfo()
| Method Detail |
|---|
public void setQueryName(java.lang.String sQueryName)
sQueryName - name of 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 database.sURL - jdbc url.sUser - the user name used to connect to 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 connectionInfo.iReadOnly - read-only property of connectionInfo.iQualifiedNamePattern - qualified pattern of table name.iExtraNamePattern - qualified name pattern.iEncodingPattern - encoding option when getting string from ResultSet.public ConnectionInfo getConnection()
public void setDistinct(boolean bDistinct)
bDistince - select distinct value to set.public boolean isDistinct()
public void setIgnorePredicateIfParamIsNull(boolean bIgnorePredicateIfParamIsNull)
bIgnorePredicateIfParamIsNull - value of option "Ignore Predicate If
Param Is Null" to 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.public TableInfo[] getTables()
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 tableiColumnIndex - the index of added columnpublic ColumnInfo getColumn(java.lang.String name)
public ColumnInfo[] getColumns()
public ColumnInfo[] getSelectColumns()
getSelectColumns(true)
Note, all columns in this array are in order as they should appear
in select clause when creating a runtime SQL statement.
getSelectColumns(boolean),
ColumnInfo.getColumnIndex()public ColumnInfo[] getSelectColumns(boolean referencedOnly)
true to
the parameter referencedOnly, only the referenced select
columns of the report will be included in the return array, otherwise
all select columns will be included.
referencedOnly - only select the columns that 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 add JoinInfo.sColumnTo - the mapping name of To column of the newly added JoinInfo.public JoinInfo[] getJoins()
public void addQbeCriterion(java.lang.String sColumnMappingName,
int iRowNumber,
java.lang.String sExpression)
sColumnMappingName - the mapping name of column which this criterion will based on.iRowNumber - row numver of criterion.sExpression - criterion in corresponding row.public QBEInfo[] getQbes()
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 of a group.public AndInfo[] getAnds()
AndInfos are
pre-defined in the query, but if you run reports through JREngine
and call JREngine.setNamedWherePortion(String) to set a pre-defined
where portion, the return AndInfo are those conditions in that where portion.
JREngine.setNamedWherePortion(String)public void setWherePortionString(java.lang.String sWherePortion)
sWherePortion - where condition string to be set to this query.public java.lang.String getWherePortionString()
jet.bean.JREngine,
you can all setWherePortion(String) 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 the SubLinkInfo to be added to this query.sValue - value of the field in main report of the SubLink to be added to this query.
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.public SubLinkInfo removeSubLink(java.lang.String sSubColName)
sSubColName - mapping name of the SubLinkInfo that will be removed.
public void removeAllSubLinks()
public SubLinkInfo[] getSubLinks()
public void addOrderBy(java.lang.String sColumnMappingName,
java.lang.String order)
sColumnMappingName - mapping name of ColumnInfo of OrderByInfo to be added to this query.order - the order of the OrderByInfo to be added to this query.public OrderByInfo[] getOrderBys()
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.
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.public ParameterInfo removeParameter(java.lang.String sParameterName)
sParameterName - mapping name of the ParameterInfo that will be removed.
public void removeAllParameters()
public ParameterInfo[] getParameters()
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 indecates if this formula is a non SQL criterion one or not.
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 indecates if this formula is a non SQL criterion one or not.public FormulaInfo[] getFormulas()
public java.lang.Object getEntityByName(java.lang.String sMappingName)
sMappingName - the name of enrity to be searched for.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||