|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.graph.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)
|
int |
hashCode()
|
boolean |
isAll()
Return whether this set query is a 'UNION ALL' or 'INTERSECT ALL' or 'EXCEPT ALL' query. |
QueryCommand |
left()
Get the left-hand query. |
Limit |
limits()
Get the limits associated with this query. |
SetQuery.Operation |
operation()
Get the set operation for this query. |
List<? extends Ordering> |
orderings()
Return the orderings for this query. |
QueryCommand |
right()
Get the right-hand 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 nullpublic 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 nullMethod Detail |
---|
protected static boolean unionableColumns(List<? extends Column> left, List<? extends Column> right)
public List<? extends Column> columns()
columns
in interface QueryCommand
QueryCommand.columns()
public Limit limits()
limits
in interface QueryCommand
unlimited
QueryCommand.limits()
public List<? extends Ordering> orderings()
orderings
in interface QueryCommand
QueryCommand.orderings()
public QueryCommand left()
public QueryCommand right()
public final SetQuery.Operation operation()
public final boolean isAll()
public String toString()
toString
in class Object
Object.toString()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public void accept(Visitor visitor)
accept
in interface Visitable
visitor
- the visitor; never nullVisitable.accept(org.modeshape.graph.query.model.Visitor)
public SetQuery withLimit(int rowLimit)
QueryCommand
withLimit
in interface QueryCommand
rowLimit
- the limit that should be used; must be a positive number
public SetQuery withOffset(int offset)
QueryCommand
withOffset
in interface QueryCommand
offset
- the limit that should be used; may not be negative
public SetQuery adding(Ordering... orderings)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |