|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.modeshape.jcr.query.model.SetQuery
@Immutable public class SetQuery
This object acts as a Set operator on multiple queries, such as performing UNION, INTERSECT, and EXCEPT
operations.
The two queries are expected to have the same number and order of columns, and the corresponding columns
types must be compatible.
| Nested Class Summary | |
|---|---|
static class |
SetQuery.Operation
|
| Constructor Summary | |
|---|---|
SetQuery(QueryCommand left,
SetQuery.Operation operation,
QueryCommand right,
boolean all)
Create a set query involving the supplied left- and right-hand-side queries. |
|
SetQuery(QueryCommand left,
SetQuery.Operation operation,
QueryCommand right,
boolean all,
List<? extends Ordering> orderings,
Limit limit)
Create a set query involving the supplied left- and right-hand-side queries. |
|
| Method Summary | |
|---|---|
void |
accept(Visitor visitor)
Accept the supplied visitor, which should call back to the visitor to complete the double-dispatch operation. |
SetQuery |
adding(Ordering... orderings)
|
List<? extends Column> |
columns()
Return the columns defining the query results. |
boolean |
equals(Object obj)
|
Column[] |
getColumns()
Gets the columns for this query. |
QueryCommand |
getLeft()
Get the left-hand query. |
Limit |
getLimits()
Get the limits associated with this query. |
String |
getOperation()
Get the set operation for this query. |
Ordering[] |
getOrderings()
Gets the orderings for this query. |
QueryCommand |
getRight()
Get the right-hand query. |
int |
hashCode()
|
boolean |
isAll()
Return whether this set query is a 'UNION ALL' or 'INTERSECT ALL' or 'EXCEPT ALL' query. |
SetQuery.Operation |
operation()
Get the set operation for this query. |
List<? extends Ordering> |
orderings()
Return the orderings for this query. |
String |
toString()
|
protected static boolean |
unionableColumns(List<? extends Column> left,
List<? extends Column> right)
|
SetQuery |
withLimit(int rowLimit)
Create a copy of this query, but one that uses the supplied limit on the number of result rows. |
SetQuery |
withOffset(int offset)
Create a copy of this query, but one that uses the supplied offset. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SetQuery(QueryCommand left,
SetQuery.Operation operation,
QueryCommand right,
boolean all)
left - the left-hand-side query being combinedoperation - the set operationright - the right-hand-side query being combinedall - true if all of the results should be included
IllegalArgumentException - if the left-hand-side query, right-hand-side query, or operation are null
public SetQuery(QueryCommand left,
SetQuery.Operation operation,
QueryCommand right,
boolean all,
List<? extends Ordering> orderings,
Limit limit)
left - the left-hand-side query being combinedoperation - the set operationright - the right-hand-side query being combinedall - true if all of the results should be includedorderings - the specification of the order of the result rows, or null if the results need not be orderedlimit - the limit for the result rows, or null if there are no limits
IllegalArgumentException - if the left-hand-side query, right-hand-side query, or operation are null| Method Detail |
|---|
protected static boolean unionableColumns(List<? extends Column> left,
List<? extends Column> right)
public List<? extends Column> columns()
QueryCommand
public Limit getLimits()
QueryCommand
getLimits in interface QueryCommandunlimitedpublic List<? extends Ordering> orderings()
QueryCommand
public QueryCommand getLeft()
SetQuery
getLeft in interface SetQuerypublic QueryCommand getRight()
SetQuery
getRight in interface SetQuerypublic final SetQuery.Operation operation()
public String getOperation()
SetQuery
getOperation in interface SetQuerypublic final boolean isAll()
SetQuery
isAll in interface SetQuerypublic Ordering[] getOrderings()
QueryCommand
getOrderings in interface QueryCommandpublic Column[] getColumns()
QueryCommand
getColumns in interface QueryCommandpublic String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic void accept(Visitor visitor)
Visitable
accept in interface Visitablevisitor - the visitor; never nullpublic SetQuery withLimit(int rowLimit)
QueryCommand
rowLimit - the limit that should be used; must be a positive number
public SetQuery withOffset(int offset)
QueryCommand
offset - the limit that should be used; may not be negative
public SetQuery adding(Ordering... orderings)
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||