|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
QueryExpression instances contain query statements in language-dependent form. A statement used as criteria for perfoming a search
Method Summary | |
void |
addGroupingExpression(ScalarExpression expr)
Method to add a grouping clause to the statement. |
void |
andCondition(BooleanExpression condition)
add an condition to the query. |
void |
andCondition(BooleanExpression condition,
boolean unionQueries)
add an condition to the query and queries involved in the union if unionQuery is true |
void |
crossJoin(LogicSetExpression tableExpr,
boolean unionQueries)
Method to add tables/crossJoin but no joins to they, will be output as FROM TABLE1,TABLE2,TABLE3 |
ClassLoaderResolver |
getClassLoaderResolver()
Accessor for the ClassLoaderResolver to use with this query statement. |
LogicSetExpression |
getDefaultTableExpression()
Accessor to the default table expression |
ScalarExpression[] |
getGroupingExpressions()
Accessor for the grouping expressions of this statement. |
BooleanExpression |
getHavingExpression()
Accessor for the having expression of this statement. |
int |
getNumberOfScalarExpressions()
Accessor for the number of ScalarExpression projected. |
ScalarExpression[] |
getOrderingExpressions()
Accessor for the ordering expressions of this statement. |
StoreManager |
getStoreManager()
Accessor for the store manager associated with this query. |
LogicSetExpression |
getTableExpression(DatastoreIdentifier rangeVar)
Accessor to the table expression for the given range identifier by rangeVar |
boolean |
hasCrossJoin(LogicSetExpression tableExpr)
Method to add tables/alias but no joins to they, will be output as FROM TABLE1,TABLE2,TABLE3 |
boolean |
hasMetaDataExpression()
Whether this query will return a meta data expression in the SELECT clause |
void |
innerJoin(ScalarExpression expr,
ScalarExpression expr2,
LogicSetExpression tblExpr,
boolean equals)
Method to do an inner join to another table. |
void |
innerJoin(ScalarExpression expr,
ScalarExpression expr2,
LogicSetExpression tblExpr,
boolean equals,
boolean unionQueries)
Method to do an inner join to another table, and optionally apply it to any unions for this query. |
void |
iorCondition(BooleanExpression condition)
add an condition to the query. |
void |
iorCondition(BooleanExpression condition,
boolean unionQueries)
add an condition to the query and queries involved in the union if unionQuery is true |
void |
leftOuterJoin(ScalarExpression expr,
ScalarExpression expr2,
LogicSetExpression tblExpr,
boolean equals)
Method to do a left outer join to another table. |
void |
leftOuterJoin(ScalarExpression expr,
ScalarExpression expr2,
LogicSetExpression tblExpr,
boolean equals,
boolean unionQueries)
Method to do a left outer join to another table, and optionally apply it to any unions for this query. |
LogicSetExpression |
newTableExpression(DatastoreContainerObject mainTable,
DatastoreIdentifier rangeVar)
Creates a table expression |
LogicSetExpression[] |
newTableExpression(DatastoreContainerObject mainTable,
DatastoreIdentifier rangeVar,
boolean unionQueries)
Creates a table expression |
void |
reset()
Allows reseting the compiled expression |
void |
rightOuterJoin(ScalarExpression expr,
ScalarExpression expr2,
LogicSetExpression tblExpr,
boolean equals)
Method to do a right outer join to another table. |
void |
rightOuterJoin(ScalarExpression expr,
ScalarExpression expr2,
LogicSetExpression tblExpr,
boolean equals,
boolean unionQueries)
Method to do a right outer join to another table, and optionally apply it to any unions for this query. |
int[] |
select(DatastoreIdentifier rangeVar,
JavaTypeMapping mapping)
Select columns, add to union queries, if unionQueries is true |
int[] |
select(DatastoreIdentifier rangeVar,
JavaTypeMapping mapping,
boolean unionQueries)
select columns, add to union queries, if unionQueries is true |
int[] |
select(JavaTypeMapping mapping)
Select the columns for a mapping |
int[] |
select(JavaTypeMapping mapping,
boolean unionQueries)
select a new column, add to union queries, if unionQueries is true |
int[] |
selectDatastoreIdentity(java.lang.String alias,
boolean unionQueries)
Select the datastore identity column. |
int[] |
selectField(java.lang.String fieldName,
java.lang.String alias,
boolean unionQueries)
Select the column(s) for the specified field in the primary table of the query. |
int |
selectScalarExpression(ScalarExpression expr)
select an expression; eg: "'Text' as alias" |
int |
selectScalarExpression(ScalarExpression expr,
boolean unionQueries)
select an expression; eg: "'Text' as alias" |
int[] |
selectVersion(java.lang.String alias,
boolean unionQueries)
Select the version column. |
void |
setDistinctResults(boolean distinctResults)
Set whether this statement returns distinct results. |
void |
setExistsSubQuery(boolean isExistsSubQuery)
Set this query is to be used as a as set for the Exists function. |
void |
setHaving(BooleanExpression expr)
Method to set the having clause of the statement. |
void |
setOrdering(ScalarExpression[] exprs,
boolean[] descending)
Mutator for the ordering criteria. |
void |
setRangeConstraint(long offset,
long count)
Method to add a range constraint on any SELECT. |
void |
setUseInnerJoinsOnly(boolean innerJoin)
Mutator for whether to only use inner joins. |
StatementText |
toDeleteStatementText()
Method to convert the criteria into a delete statement text. |
StatementText |
toStatementText(boolean lock)
Method to convert the criteria into the statement text. |
void |
union(QueryExpression qe)
Union two QueryExpressions this and qe . |
Method Detail |
public boolean hasMetaDataExpression()
public LogicSetExpression getTableExpression(DatastoreIdentifier rangeVar)
rangeVar
rangeVar
- the range variable identifier
public LogicSetExpression getDefaultTableExpression()
public StoreManager getStoreManager()
public ClassLoaderResolver getClassLoaderResolver()
public void setDistinctResults(boolean distinctResults)
distinctResults
- Whether we return distinct resultspublic void setUseInnerJoinsOnly(boolean innerJoin)
innerJoin
- Whether to only use inner joinspublic LogicSetExpression newTableExpression(DatastoreContainerObject mainTable, DatastoreIdentifier rangeVar)
mainTable
- the main tablerangeVar
- the range var
public LogicSetExpression[] newTableExpression(DatastoreContainerObject mainTable, DatastoreIdentifier rangeVar, boolean unionQueries)
mainTable
- the main tablerangeVar
- the range varunionQueries
- Whether to add to any union
public int[] selectDatastoreIdentity(java.lang.String alias, boolean unionQueries)
alias
- Alias to use for this columnunionQueries
- Whether to select the datastore id column of all unioned tables
public int[] selectVersion(java.lang.String alias, boolean unionQueries)
alias
- Alias to use for this columnunionQueries
- Whether to select the version column of all unioned tables
public int[] selectField(java.lang.String fieldName, java.lang.String alias, boolean unionQueries)
fieldName
- Name of the fieldalias
- Alias to use for these column(s)unionQueries
- Whether to select the field column(s) of all unioned queries.
public int[] select(JavaTypeMapping mapping)
mapping
- The mapping
public int[] select(JavaTypeMapping mapping, boolean unionQueries)
mapping
- The mappingunionQueries
- Whether to add to any union
public int selectScalarExpression(ScalarExpression expr)
expr
- The expression to add to the select statement
public int selectScalarExpression(ScalarExpression expr, boolean unionQueries)
expr
- The expression to add to the select statementunionQueries
- whether to apply the select in all queries unified by the union clause
public int[] select(DatastoreIdentifier rangeVar, JavaTypeMapping mapping)
rangeVar
- The range variablemapping
- The mapping
public int[] select(DatastoreIdentifier rangeVar, JavaTypeMapping mapping, boolean unionQueries)
rangeVar
- The range variablemapping
- The mappingunionQueries
- Whether to add to any union
public void andCondition(BooleanExpression condition)
condition
- the Boolean expressionpublic void andCondition(BooleanExpression condition, boolean unionQueries)
condition
- the Boolean expressionunionQueries
- whether to apply the condition in all queries unified by the union clausepublic void crossJoin(LogicSetExpression tableExpr, boolean unionQueries)
tableExpr
- table expressionunionQueries
- Whether to apply the alias to unions of this query.public boolean hasCrossJoin(LogicSetExpression tableExpr)
tableExpr
- table expressionpublic void innerJoin(ScalarExpression expr, ScalarExpression expr2, LogicSetExpression tblExpr, boolean equals, boolean unionQueries)
expr
- the left hand expressionexpr2
- the right hand expressiontblExpr
- theequals
- if the join is applied as filter, if use equals or not equalsunionQueries
- whether to apply the inner join in all queries unified by the union clausepublic void innerJoin(ScalarExpression expr, ScalarExpression expr2, LogicSetExpression tblExpr, boolean equals)
expr
- the left hand expressionexpr2
- the right hand expressiontblExpr
- The table expression for the table to apply the joinequals
- if the join is applied as filter, if use equals or not equalspublic void leftOuterJoin(ScalarExpression expr, ScalarExpression expr2, LogicSetExpression tblExpr, boolean equals, boolean unionQueries)
expr
- the left hand expressionexpr2
- the right hand expressiontblExpr
- The table expression for the table to apply the joinequals
- if the join is applied as filter, if use equals or not equalsunionQueries
- Whether to apply to unions of this query.public void leftOuterJoin(ScalarExpression expr, ScalarExpression expr2, LogicSetExpression tblExpr, boolean equals)
expr
- the left hand expressionexpr2
- the right hand expressiontblExpr
- The table expressionequals
- if the join is applied as filter, if use equals or not equalspublic void rightOuterJoin(ScalarExpression expr, ScalarExpression expr2, LogicSetExpression tblExpr, boolean equals, boolean unionQueries)
expr
- the left hand expressionexpr2
- the right hand expressiontblExpr
- The table expression for the table to apply the joinequals
- if the join is applied as filter, if use equals or not equalsunionQueries
- Whether to apply to unions of this query.public void rightOuterJoin(ScalarExpression expr, ScalarExpression expr2, LogicSetExpression tblExpr, boolean equals)
expr
- the left hand expressionexpr2
- the right hand expressiontblExpr
- The table expression for the table to apply the joinequals
- if the join is applied as filter, if use equals or not equalspublic void addGroupingExpression(ScalarExpression expr)
expr
- The group by expressionpublic ScalarExpression[] getGroupingExpressions()
public void setHaving(BooleanExpression expr)
expr
- The having expressionpublic BooleanExpression getHavingExpression()
public void setOrdering(ScalarExpression[] exprs, boolean[] descending)
exprs
- The expressions to order bydescending
- Whether each expression is ascending/descendingpublic ScalarExpression[] getOrderingExpressions()
public StatementText toStatementText(boolean lock)
lock
- whether to lock the instances using this statement
public void union(QueryExpression qe)
this
and qe
.
Both QueryExpressions must have the same ScalarExpressions selected,
and they must be in the same select order.
valid:
e.g. a) fieldA, fieldB, fieldE, fieldC
b) fieldA, fieldB, fieldE, fieldC
invalid:
e.g. a) fieldA, fieldE, fieldB, fieldC
b) fieldA, fieldB, fieldE, fieldC
qe
- the QueryExpressionpublic void iorCondition(BooleanExpression condition)
condition
- the Boolean expressionpublic void iorCondition(BooleanExpression condition, boolean unionQueries)
condition
- the Boolean expressionunionQueries
- whether to apply the condition in all queries unified by the union clausepublic void setRangeConstraint(long offset, long count)
offset
- The offset to start fromcount
- The number of records to returnpublic void setExistsSubQuery(boolean isExistsSubQuery)
isExistsSubQuery
- The isExistsSubQuery to set.public StatementText toDeleteStatementText()
public int getNumberOfScalarExpressions()
public void reset()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |