|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.query.QueryStatement
public class QueryStatement
Representation of a statement for a Query. Provides methods to specify joins to other tables and to select columns from these tables. Provides methods to apply restrictions on the result. The resultant statement consists of a SELECT clause, a FROM clause and a WHERE clause. Provides output as either a SELECT statement or as a DELETE statement. The DELETE form of the statement uses just the FROM and WHERE clauses. This statement may represent a subquery.
| Nested Class Summary | |
|---|---|
static class |
QueryStatement.Join
A join in a query. |
| Field Summary | |
|---|---|
protected java.lang.String |
candidateAlias
Candidate alias used by the query (defaults to "this"). |
protected java.lang.Class |
candidateClass
Candidate class for the query. |
protected java.util.List<org.datanucleus.store.mapped.expression.LogicSetExpression> |
crossJoins
Cross joins. |
protected boolean |
distinctResults
Whether to make results distinct. |
protected java.util.HashMap<java.lang.String,java.lang.Object> |
extensions
Map of extensions, keyed by the extension name. |
protected java.util.List<org.datanucleus.store.mapped.expression.ScalarExpression> |
groupingExpressions
Expression(s) for the GROUP BY clause. |
protected boolean |
hasAggregateExpression
whether there is an aggregate expression present in the select |
protected org.datanucleus.store.mapped.expression.BooleanExpression |
havingExpr
Expression for any HAVING clause. |
protected boolean |
isExistsSubQuery
Whether this query is to be used as a as set for the Exists function. |
protected java.util.List<QueryStatement.Join> |
joins
inner/left/right joins |
protected java.util.List<org.datanucleus.store.mapped.DatastoreIdentifier> |
joinsToTableAliases
Internal List of table aliases, to ensure that we don't have duplicate JOINs From vs To |
protected static org.datanucleus.util.Localiser |
LOCALISER
Localisation for messages. |
protected org.datanucleus.store.mapped.DatastoreIdentifier |
mainTableAlias
Alias for the main table. |
protected org.datanucleus.store.mapped.expression.LogicSetExpression |
mainTableExpr
Table expression for the main table of this statement. |
protected boolean[] |
orderingDirections
Directions for any ORDER BY expressions (1 for each orderingExpressions entry). |
protected org.datanucleus.store.mapped.expression.ScalarExpression[] |
orderingExpressions
Expressions for any ORDER BY clause. |
protected long |
rangeCount
The number of records to be retrieved in any range restriction. |
protected long |
rangeOffset
The offset for any range restriction. |
protected java.util.List<java.lang.String> |
selected
Expression(s) for selected fields/columns. |
protected org.datanucleus.store.mapped.expression.StatementText |
stmtText
Statement text for this Query Statement. |
protected org.datanucleus.store.mapped.MappedStoreManager |
storeMgr
Store Manager. |
protected java.util.Map<org.datanucleus.store.mapped.DatastoreIdentifier,org.datanucleus.store.mapped.expression.LogicSetExpression> |
tableExprsByAlias
|
protected java.util.List<QueryStatement> |
union
List of unioned query expressions. |
protected org.datanucleus.store.mapped.expression.ScalarExpression[] |
updateExprs
Update condition |
protected org.datanucleus.store.mapped.expression.BooleanExpression |
whereExpr
Expression for the WHERE clause. |
| Constructor Summary | |
|---|---|
QueryStatement(org.datanucleus.store.mapped.DatastoreContainerObject mainTable,
org.datanucleus.store.mapped.DatastoreIdentifier alias,
org.datanucleus.ClassLoaderResolver clr)
Constructor, allowing the specification of the alias of the main table. |
|
| Method Summary | |
|---|---|
void |
addExtension(java.lang.String key,
java.lang.Object value)
Method to define an extension for this query statement allowing control over its behaviour in generating a query. |
void |
addGroupingExpression(org.datanucleus.store.mapped.expression.ScalarExpression expr)
Method to add a grouping expression to the query. |
protected void |
addOrderingColumnsToSelect()
Convenience method to add any necessary columns to the SELECT that are needed by the ordering constraint. |
void |
andCondition(org.datanucleus.store.mapped.expression.BooleanExpression condition)
Method to add an additional WHERE clause to the query. |
void |
andCondition(org.datanucleus.store.mapped.expression.BooleanExpression condition,
boolean unionQueries)
add an condition to the query and queries involved in the union if unionQuery is true |
protected void |
assertNotFrozen()
Assert if the statement text is already generated. |
void |
crossJoin(org.datanucleus.store.mapped.expression.LogicSetExpression tableExpr,
boolean unionQueries)
Method to add a cross-join to the supplied table. |
protected org.datanucleus.store.mapped.expression.StatementText |
generateOrderingStatement()
Convenience method to generate the ordering statement to add to the overall query statement. |
java.lang.String |
getCandidateAlias()
Accessor for the candidate alias in use by the query. |
java.lang.Class |
getCandidateClass()
Accessor for the candidate class of the query expression. |
org.datanucleus.ClassLoaderResolver |
getClassLoaderResolver()
Accessor for the class-loader resolver. |
java.util.HashMap |
getExtensions()
Accessor for the extensions for this expression. |
org.datanucleus.store.mapped.DatastoreIdentifier |
getMainTableAlias()
Accessor for the main table identifier alias. |
org.datanucleus.store.mapped.expression.LogicSetExpression |
getMainTableExpression()
Accessor for the main table of this statement. |
int |
getNumberOfScalarExpressions()
Accessor for the number of ScalarExpression projected. |
org.datanucleus.store.mapped.expression.QueryExpression |
getParent()
Accessor for the parent QueryExpression if this is a nested expression. |
org.datanucleus.store.mapped.MappedStoreManager |
getStoreManager()
Accessor for the Store Manager. |
org.datanucleus.store.mapped.expression.LogicSetExpression |
getTableExpression(org.datanucleus.store.mapped.DatastoreIdentifier alias)
Accessor for the table with the specified "alias". |
java.lang.Object |
getValueForExtension(java.lang.String key)
Accessor for the value for an extension. |
boolean |
hasCrossJoin(org.datanucleus.store.mapped.expression.LogicSetExpression tableExpr)
Method to return if the query statement has a cross join involving the supplied table expression. |
boolean |
hasNucleusTypeExpression()
Whether this query will return a meta data expression (containing NUCLEUS_TYPE). |
void |
innerJoin(org.datanucleus.store.mapped.expression.ScalarExpression expr,
org.datanucleus.store.mapped.expression.ScalarExpression expr2,
org.datanucleus.store.mapped.expression.LogicSetExpression tblExpr,
boolean equals)
Method to do an inner join to another table. |
void |
innerJoin(org.datanucleus.store.mapped.expression.ScalarExpression expr,
org.datanucleus.store.mapped.expression.ScalarExpression expr2,
org.datanucleus.store.mapped.expression.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(org.datanucleus.store.mapped.expression.BooleanExpression condition)
Method to add an IOR condition to the WHERE clause of the statement. |
void |
iorCondition(org.datanucleus.store.mapped.expression.BooleanExpression condition,
boolean unionQueries)
add an condition to the query and queries involved in the union if unionQuery is true |
void |
leftOuterJoin(org.datanucleus.store.mapped.expression.ScalarExpression expr,
org.datanucleus.store.mapped.expression.ScalarExpression expr2,
org.datanucleus.store.mapped.expression.LogicSetExpression tblExpr,
boolean equals)
Method to do a left outer join to another table. |
void |
leftOuterJoin(org.datanucleus.store.mapped.expression.ScalarExpression expr,
org.datanucleus.store.mapped.expression.ScalarExpression expr2,
org.datanucleus.store.mapped.expression.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. |
org.datanucleus.store.mapped.expression.LogicSetExpression |
newTableExpression(org.datanucleus.store.mapped.DatastoreContainerObject table,
org.datanucleus.store.mapped.DatastoreIdentifier alias)
Method to return the table expression for a new table, and add to the managed table expressions for this query. |
org.datanucleus.store.mapped.expression.LogicSetExpression[] |
newTableExpression(org.datanucleus.store.mapped.DatastoreContainerObject table,
org.datanucleus.store.mapped.DatastoreIdentifier alias,
boolean unionQueries)
Method to return the table expression for a new table, and add to the managed table expressions for this query. |
void |
reset()
Resets the compiled expression statement. |
void |
rightOuterJoin(org.datanucleus.store.mapped.expression.ScalarExpression expr,
org.datanucleus.store.mapped.expression.ScalarExpression expr2,
org.datanucleus.store.mapped.expression.LogicSetExpression tblExpr,
boolean equals)
Method to do a right outer join to another table. |
void |
rightOuterJoin(org.datanucleus.store.mapped.expression.ScalarExpression expr,
org.datanucleus.store.mapped.expression.ScalarExpression expr2,
org.datanucleus.store.mapped.expression.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(org.datanucleus.store.mapped.DatastoreIdentifier tableAlias,
org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
Select columns of the specified mapping for the table identifier. |
int[] |
select(org.datanucleus.store.mapped.DatastoreIdentifier tableAlias,
org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping,
boolean unionQueries)
select columns, add to union queries, if unionQueries is true |
int[] |
select(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
Select the columns for a mapping. |
int[] |
select(org.datanucleus.store.mapped.mapping.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 of the primary table of the query. |
int[] |
selectField(java.lang.String fieldName,
java.lang.String alias,
boolean unionQueries)
Select the column(s) for the specified field of the primary table of the query. |
int |
selectScalarExpression(org.datanucleus.store.mapped.expression.ScalarExpression expr)
Select an expression. |
int |
selectScalarExpression(org.datanucleus.store.mapped.expression.ScalarExpression expr,
boolean unionQueries)
Select an expression. |
int[] |
selectVersion(java.lang.String alias,
boolean unionQueries)
Select the version column of the primary table of the query. |
void |
setCandidateInformation(java.lang.Class cls,
java.lang.String alias)
Method to set the candidate class and alias in use by the query. |
void |
setDistinctResults(boolean distinctResults)
Mutator for whether the query returns distinct results. |
void |
setExistsSubQuery(boolean isExistsSubQuery)
Set this query is to be used as a set for the Exists function. |
void |
setHaving(org.datanucleus.store.mapped.expression.BooleanExpression expr)
Mutator for the "having" expression. |
void |
setOrdering(org.datanucleus.store.mapped.expression.ScalarExpression[] exprs,
boolean[] descending)
Mutator for the ordering criteria. |
void |
setParent(org.datanucleus.store.mapped.expression.QueryExpression parentQueryExpr)
Sets the parent QueryExpression of this query. |
void |
setRangeConstraint(long offset,
long count)
Method to add a range constraint on any SELECT. |
void |
setUpdates(org.datanucleus.store.mapped.expression.ScalarExpression[] exprs)
Method to set the UPDATE clause of the statement. |
org.datanucleus.store.mapped.expression.StatementText |
toDeleteStatementText()
Method to convert the criteria into a delete statement text. |
org.datanucleus.store.mapped.expression.StatementText |
toStatementText(boolean lock)
Method to convert the criteria into the statement text. |
org.datanucleus.store.mapped.expression.StatementText |
toUpdateStatementText()
Method to convert the criteria into an update statement text. |
void |
union(org.datanucleus.store.mapped.expression.QueryExpression expr)
Method to union this query statement with another query statement. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.datanucleus.util.Localiser LOCALISER
protected final org.datanucleus.store.mapped.MappedStoreManager storeMgr
protected java.lang.Class candidateClass
protected java.lang.String candidateAlias
protected final org.datanucleus.store.mapped.DatastoreIdentifier mainTableAlias
protected final org.datanucleus.store.mapped.expression.LogicSetExpression mainTableExpr
protected java.util.Map<org.datanucleus.store.mapped.DatastoreIdentifier,org.datanucleus.store.mapped.expression.LogicSetExpression> tableExprsByAlias
protected java.util.List<QueryStatement> union
protected boolean isExistsSubQuery
e.g WHERE EXISTS(QUERY).
protected boolean distinctResults
protected java.util.List<java.lang.String> selected
protected boolean hasAggregateExpression
protected java.util.List<QueryStatement.Join> joins
protected java.util.List<org.datanucleus.store.mapped.DatastoreIdentifier> joinsToTableAliases
protected java.util.List<org.datanucleus.store.mapped.expression.LogicSetExpression> crossJoins
protected org.datanucleus.store.mapped.expression.BooleanExpression whereExpr
protected java.util.List<org.datanucleus.store.mapped.expression.ScalarExpression> groupingExpressions
protected org.datanucleus.store.mapped.expression.BooleanExpression havingExpr
protected org.datanucleus.store.mapped.expression.ScalarExpression[] orderingExpressions
protected boolean[] orderingDirections
protected org.datanucleus.store.mapped.expression.ScalarExpression[] updateExprs
protected long rangeOffset
protected long rangeCount
protected java.util.HashMap<java.lang.String,java.lang.Object> extensions
protected org.datanucleus.store.mapped.expression.StatementText stmtText
| Constructor Detail |
|---|
public QueryStatement(org.datanucleus.store.mapped.DatastoreContainerObject mainTable,
org.datanucleus.store.mapped.DatastoreIdentifier alias,
org.datanucleus.ClassLoaderResolver clr)
mainTable - The main table for this statement.alias - The alias for the main tableclr - ClassLoader resolver.| Method Detail |
|---|
public void setCandidateInformation(java.lang.Class cls,
java.lang.String alias)
setCandidateInformation in interface org.datanucleus.store.mapped.expression.QueryExpressioncls - The candidate classalias - The aliaspublic java.lang.Class getCandidateClass()
getCandidateClass in interface org.datanucleus.store.mapped.expression.QueryExpressionpublic java.lang.String getCandidateAlias()
getCandidateAlias in interface org.datanucleus.store.mapped.expression.QueryExpressionpublic void reset()
reset in interface org.datanucleus.store.mapped.expression.QueryExpressionpublic void setParent(org.datanucleus.store.mapped.expression.QueryExpression parentQueryExpr)
SELECT 1 FROM PARENT WHERE EXISTS (SELECT 1 FROM THIS)
The parent QueryExpression is the outer SELECT, and this QueryExpression is the inner SELECT.
setParent in interface org.datanucleus.store.mapped.expression.QueryExpressionparentQueryExpr - the parent of this querypublic org.datanucleus.store.mapped.expression.QueryExpression getParent()
getParent in interface org.datanucleus.store.mapped.expression.QueryExpressionpublic org.datanucleus.ClassLoaderResolver getClassLoaderResolver()
getClassLoaderResolver in interface org.datanucleus.store.mapped.expression.QueryExpressionpublic org.datanucleus.store.mapped.MappedStoreManager getStoreManager()
getStoreManager in interface org.datanucleus.store.mapped.expression.QueryExpressionpublic void setDistinctResults(boolean distinctResults)
setDistinctResults in interface org.datanucleus.store.mapped.expression.QueryExpressiondistinctResults - Whether to return distinctpublic void setExistsSubQuery(boolean isExistsSubQuery)
setExistsSubQuery in interface org.datanucleus.store.mapped.expression.QueryExpressionisExistsSubQuery - The isExistsSubQuery to set.public void union(org.datanucleus.store.mapped.expression.QueryExpression expr)
union in interface org.datanucleus.store.mapped.expression.QueryExpressionexpr - The other query statement to union
public void addExtension(java.lang.String key,
java.lang.Object value)
addExtension in interface org.datanucleus.store.mapped.expression.QueryExpressionkey - Extension keyvalue - Value for the keypublic java.lang.Object getValueForExtension(java.lang.String key)
getValueForExtension in interface org.datanucleus.store.mapped.expression.QueryExpressionkey - Key for the extension
public java.util.HashMap getExtensions()
getExtensions in interface org.datanucleus.store.mapped.expression.QueryExpression
public int[] selectDatastoreIdentity(java.lang.String alias,
boolean unionQueries)
selectDatastoreIdentity in interface org.datanucleus.store.mapped.expression.QueryExpressionalias - Alias to use for the selected datastore identity column (if any)unionQueries - Whether to apply to the primary table of any unioned tables
public int[] selectVersion(java.lang.String alias,
boolean unionQueries)
selectVersion in interface org.datanucleus.store.mapped.expression.QueryExpressionalias - Alias to use for the selected version column (if any)unionQueries - Whether to also select the version column of the primary table of any unioned queries
public int[] selectField(java.lang.String fieldName,
java.lang.String alias,
boolean unionQueries)
selectField in interface org.datanucleus.store.mapped.expression.QueryExpressionfieldName - Name of the field to select.alias - Alias to use for the selected field column(s) (if any).unionQueries - Whether to also select the field column(s) of the primary table of any unioned queries
public int[] select(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
select in interface org.datanucleus.store.mapped.expression.QueryExpressionmapping - The mapping
public int[] select(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping,
boolean unionQueries)
select in interface org.datanucleus.store.mapped.expression.QueryExpressionmapping - The mappingunionQueries - Whether to add to any union
public int[] select(org.datanucleus.store.mapped.DatastoreIdentifier tableAlias,
org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
select in interface org.datanucleus.store.mapped.expression.QueryExpressiontableAlias - The alias for the tablemapping - The mapping
public int[] select(org.datanucleus.store.mapped.DatastoreIdentifier tableAlias,
org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping,
boolean unionQueries)
select in interface org.datanucleus.store.mapped.expression.QueryExpressiontableAlias - The alias for the tablemapping - The mappingunionQueries - Whether to add to any union
public int selectScalarExpression(org.datanucleus.store.mapped.expression.ScalarExpression expr)
selectScalarExpression in interface org.datanucleus.store.mapped.expression.QueryExpressionexpr - The expression to add to the select statement
public int selectScalarExpression(org.datanucleus.store.mapped.expression.ScalarExpression expr,
boolean unionQueries)
selectScalarExpression in interface org.datanucleus.store.mapped.expression.QueryExpressionexpr - The expression to add to the select statementunionQueries - whether to apply the select in all queries unified by the union clause
public int getNumberOfScalarExpressions()
getNumberOfScalarExpressions in interface org.datanucleus.store.mapped.expression.QueryExpressionpublic boolean hasNucleusTypeExpression()
hasNucleusTypeExpression in interface org.datanucleus.store.mapped.expression.QueryExpressionpublic org.datanucleus.store.mapped.expression.LogicSetExpression getMainTableExpression()
getMainTableExpression in interface org.datanucleus.store.mapped.expression.QueryExpressionpublic org.datanucleus.store.mapped.DatastoreIdentifier getMainTableAlias()
getMainTableAlias in interface org.datanucleus.store.mapped.expression.QueryExpressionpublic org.datanucleus.store.mapped.expression.LogicSetExpression getTableExpression(org.datanucleus.store.mapped.DatastoreIdentifier alias)
getTableExpression in interface org.datanucleus.store.mapped.expression.QueryExpressionalias - Alias for the table required
public org.datanucleus.store.mapped.expression.LogicSetExpression newTableExpression(org.datanucleus.store.mapped.DatastoreContainerObject table,
org.datanucleus.store.mapped.DatastoreIdentifier alias)
newTableExpression in interface org.datanucleus.store.mapped.expression.QueryExpressiontable - The tablealias - Alias for the table
public org.datanucleus.store.mapped.expression.LogicSetExpression[] newTableExpression(org.datanucleus.store.mapped.DatastoreContainerObject table,
org.datanucleus.store.mapped.DatastoreIdentifier alias,
boolean unionQueries)
newTableExpression in interface org.datanucleus.store.mapped.expression.QueryExpressiontable - The tablealias - Alias for the tableunionQueries - Whether to apply to all unioned query statements.
public void innerJoin(org.datanucleus.store.mapped.expression.ScalarExpression expr,
org.datanucleus.store.mapped.expression.ScalarExpression expr2,
org.datanucleus.store.mapped.expression.LogicSetExpression tblExpr,
boolean equals,
boolean unionQueries)
innerJoin in interface org.datanucleus.store.mapped.expression.QueryExpressionexpr - 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 clause
public void innerJoin(org.datanucleus.store.mapped.expression.ScalarExpression expr,
org.datanucleus.store.mapped.expression.ScalarExpression expr2,
org.datanucleus.store.mapped.expression.LogicSetExpression tblExpr,
boolean equals)
innerJoin in interface org.datanucleus.store.mapped.expression.QueryExpressionexpr - 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 equals
public void leftOuterJoin(org.datanucleus.store.mapped.expression.ScalarExpression expr,
org.datanucleus.store.mapped.expression.ScalarExpression expr2,
org.datanucleus.store.mapped.expression.LogicSetExpression tblExpr,
boolean equals,
boolean unionQueries)
leftOuterJoin in interface org.datanucleus.store.mapped.expression.QueryExpressionexpr - 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(org.datanucleus.store.mapped.expression.ScalarExpression expr,
org.datanucleus.store.mapped.expression.ScalarExpression expr2,
org.datanucleus.store.mapped.expression.LogicSetExpression tblExpr,
boolean equals)
leftOuterJoin in interface org.datanucleus.store.mapped.expression.QueryExpressionexpr - the left hand expressionexpr2 - the right hand expressiontblExpr - The table expressionequals - if the join is applied as filter, if use equals or not equals
public void rightOuterJoin(org.datanucleus.store.mapped.expression.ScalarExpression expr,
org.datanucleus.store.mapped.expression.ScalarExpression expr2,
org.datanucleus.store.mapped.expression.LogicSetExpression tblExpr,
boolean equals,
boolean unionQueries)
rightOuterJoin in interface org.datanucleus.store.mapped.expression.QueryExpressionexpr - 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(org.datanucleus.store.mapped.expression.ScalarExpression expr,
org.datanucleus.store.mapped.expression.ScalarExpression expr2,
org.datanucleus.store.mapped.expression.LogicSetExpression tblExpr,
boolean equals)
rightOuterJoin in interface org.datanucleus.store.mapped.expression.QueryExpressionexpr - 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 boolean hasCrossJoin(org.datanucleus.store.mapped.expression.LogicSetExpression tableExpr)
hasCrossJoin in interface org.datanucleus.store.mapped.expression.QueryExpressiontableExpr - table expression
public void crossJoin(org.datanucleus.store.mapped.expression.LogicSetExpression tableExpr,
boolean unionQueries)
FROM TABLE1,TABLE2,TABLE3
crossJoin in interface org.datanucleus.store.mapped.expression.QueryExpressiontableExpr - table expressionunionQueries - Whether to apply the alias to unions of this query.
public void andCondition(org.datanucleus.store.mapped.expression.BooleanExpression condition,
boolean unionQueries)
andCondition in interface org.datanucleus.store.mapped.expression.QueryExpressioncondition - the Boolean expressionunionQueries - whether to apply the condition in all queries unified by the union clausepublic void andCondition(org.datanucleus.store.mapped.expression.BooleanExpression condition)
andCondition in interface org.datanucleus.store.mapped.expression.QueryExpressioncondition - The where clause expression
public void iorCondition(org.datanucleus.store.mapped.expression.BooleanExpression condition,
boolean unionQueries)
iorCondition in interface org.datanucleus.store.mapped.expression.QueryExpressioncondition - the Boolean expressionunionQueries - whether to apply the condition in all queries unified by the union clausepublic void iorCondition(org.datanucleus.store.mapped.expression.BooleanExpression condition)
iorCondition in interface org.datanucleus.store.mapped.expression.QueryExpressioncondition - The WHERE clause expressionpublic void addGroupingExpression(org.datanucleus.store.mapped.expression.ScalarExpression expr)
addGroupingExpression in interface org.datanucleus.store.mapped.expression.QueryExpressionexpr - The expressionpublic void setHaving(org.datanucleus.store.mapped.expression.BooleanExpression expr)
setHaving in interface org.datanucleus.store.mapped.expression.QueryExpressionexpr - Boolean expression for the having clause
public void setOrdering(org.datanucleus.store.mapped.expression.ScalarExpression[] exprs,
boolean[] descending)
setOrdering in interface org.datanucleus.store.mapped.expression.QueryExpressionexprs - The expressions to order bydescending - Whether each expression is ascending/descending
public void setRangeConstraint(long offset,
long count)
setRangeConstraint in interface org.datanucleus.store.mapped.expression.QueryExpressionoffset - The offset to start fromcount - The number of records to returnprotected void addOrderingColumnsToSelect()
protected org.datanucleus.store.mapped.expression.StatementText generateOrderingStatement()
public void setUpdates(org.datanucleus.store.mapped.expression.ScalarExpression[] exprs)
setUpdates in interface org.datanucleus.store.mapped.expression.QueryExpressionexprs - The update clause expressionpublic org.datanucleus.store.mapped.expression.StatementText toDeleteStatementText()
DELETE FROM TBL THIS WHERE THIS.COL3 = VAL3
toDeleteStatementText in interface org.datanucleus.store.mapped.expression.QueryExpressionpublic org.datanucleus.store.mapped.expression.StatementText toUpdateStatementText()
UPDATE TBL THIS SET THIS.COL1 = VAL1, THIS.COL2 = VAL2 WHERE THIS.COL3 = VAL3
toUpdateStatementText in interface org.datanucleus.store.mapped.expression.QueryExpressionpublic org.datanucleus.store.mapped.expression.StatementText toStatementText(boolean lock)
toStatementText in interface org.datanucleus.store.mapped.expression.QueryExpressionlock - whether to lock the instances using this statement
protected void assertNotFrozen()
org.datanucleus.exceptions.NucleusException - Thrown if the statement is already generated
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||